Results 1 to 1 of 1
Thread: Send Mail in code (VB6)
2005-03-30, 22:14 #1
- Join Date
- Sep 2004
- Nashville, Tennessee, USA
- Thanked 0 Times in 0 Posts
Send Mail in code (VB6)
I recently changed from using code that relied on having Outlook open to send mail from a stand alone document
processing program to the following code which does not require the overhead of another program, it works well
from my developer PC but fails on the production PC with the error:
<hr>The "SendUsing" configuration value is invalid.<hr>
<pre> Dim objMsg As New CDO.Message
Dim objConf As New CDO.Configuration
Dim Flds As ADODB.Fields
Msg = "One or more new Public Chapter documents received."
Set Flds = objConf.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "mail2k3"
.Item(cdoSMTPConnectionTimeout) = 100
.Item(cdoURLGetLatestVersion) = True
'use for testing
.To = "firstname.lastname@example.org" & " <email@example.com> "
.From = "firstname.lastname@example.org" & " <email@example.com> "
.Subject = "Public Chapter Received"
.TextBody = Msg & vbCrLf
Any suggestions would be greatly appreciated.