View Single Post
Old 09-20-2012, 12:15 AM   PM User | #5
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,168
Thanks: 59
Thanked 3,993 Times in 3,962 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
You know, there MIGHT be something wrong there, more I look at it.

You never actually create the configuration *OBJECT*.

I usually do the two steps separately, like this:
Code:
' first create the configuration object:
Set ObjConfig=CreateObject("CDO.Configuration")
ObjConfig.Fields.Item ( "http://schemas.microsoft.com/cdo/configuration/sendusing" ) = 2 'Send the message using the network (SMTP over the network).
ObjConfig.Fields.Item ( "http://schemas.microsoft.com/cdo/configuration/smtpserver" ) = "mail.reliablesite.net"
ObjConfig.Fields.Item ( "http://schemas.microsoft.com/cdo/configuration/smtpserverport" ) = 25
ObjConfig.Fields.Item ( "http://schemas.microsoft.com/cdo/configuration/smtpusessl" ) = False 
ObjConfig.Fields.Item ( "http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout" ) = 60

ObjConfig.Fields.Item ( "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate" ) = 1 'basic (clear-text) authentication
ObjConfig.Fields.Item ( "http://schemas.microsoft.com/cdo/configuration/sendusername" ) ="noreply@ontarioabandonedplaces.com"
ObjConfig.Fields.Item ( "http://schemas.microsoft.com/cdo/configuration/sendpassword" ) = "password1"
ObjConfig.Fields.Update


' then create the mail object 
Set ObjSendMail = CreateObject( "CDO.Message" ) 
' and then set the configuration in the message object
Set objSendMail.Configuration=objConfig

...
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote