Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CDO problem
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Miscellaneous
Thread ID:
01459718
Message ID:
01459737
Views:
80
Does it work if you run it 'as admin'?

>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
>
>
>*----- Code for testing ----------------------------
>Local o
>o = CreateObject("CDO.Message") 
>     
>* This section provides the configuration information for the remote SMTP server.
>     
>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
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform