The following code successfully sends emails in the XpMode VPC of my Windows 7. However it shows the following message when I run it in the Windows 7 of the same computer.
"OLE IDispatch exception code 0 from CDO.Message.1: The transport failed to connect to the server."
Can anybody help?
Ben
TIA
Local o
o = CreateObject("CDO.Message")
o.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
o.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="relay.welkin.com.hk"
o.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
o.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = .T.
o.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
o.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
o.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="MyUsername"
o.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="MyPassword"
o.Configuration.Fields.Update
o.Subject="Example"
o.From="ben@mymailserver.com.hk"
o.To="myhotmailaccount@hotmail.com"
o.TextBody="This is a test"
o.Send