A
AB
Hi,
The below code had been working fine for ages (XP, Office 2003) and
now that I switched to a new pc and W7, Office 2010 it fails to send
email (i.e., fails to connect to the server). There must be a simple
fix for this that i'm unable to locate. Your help would be greatly
appreciated!
The code that works fine on my old machine:
Sub SendMyMail()
Dim cdomsg As CDO.Message
Set cdomsg = New CDO.Message
With cdomsg.Configuration.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")
= 2 'NTLM method
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")
= "smtp.gmail.com"
.Item("http://schemas.microsoft.com/cdo/configuration/
smptserverport") = 465 '587
.Item("http://schemas.microsoft.com/cdo/configuration/
smtpauthenticate") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl")
= True
.Item("http://schemas.microsoft.com/cdo/configuration/
smtpconnectiontimeout") = 60
.Item("http://schemas.microsoft.com/cdo/configuration/
sendusername") = "(e-mail address removed)"
.Item("http://schemas.microsoft.com/cdo/configuration/
sendpassword") = "myPwd"
.Update
End With
With cdomsg
.To = "(e-mail address removed)"
.From = "(e-mail address removed)"
.Subject = "mySubj "
.TextBody = "myText"
.send
End Sub
So, on the .send line it fails with error: "The transport failed to
connect to the server.". I tried disabling Firewall alltogether but to
no avail (i.e., i disabled the firewall but it didn't make a
difference).
Any ideas?
A.
The below code had been working fine for ages (XP, Office 2003) and
now that I switched to a new pc and W7, Office 2010 it fails to send
email (i.e., fails to connect to the server). There must be a simple
fix for this that i'm unable to locate. Your help would be greatly
appreciated!
The code that works fine on my old machine:
Sub SendMyMail()
Dim cdomsg As CDO.Message
Set cdomsg = New CDO.Message
With cdomsg.Configuration.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")
= 2 'NTLM method
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")
= "smtp.gmail.com"
.Item("http://schemas.microsoft.com/cdo/configuration/
smptserverport") = 465 '587
.Item("http://schemas.microsoft.com/cdo/configuration/
smtpauthenticate") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl")
= True
.Item("http://schemas.microsoft.com/cdo/configuration/
smtpconnectiontimeout") = 60
.Item("http://schemas.microsoft.com/cdo/configuration/
sendusername") = "(e-mail address removed)"
.Item("http://schemas.microsoft.com/cdo/configuration/
sendpassword") = "myPwd"
.Update
End With
With cdomsg
.To = "(e-mail address removed)"
.From = "(e-mail address removed)"
.Subject = "mySubj "
.TextBody = "myText"
.send
End Sub
So, on the .send line it fails with error: "The transport failed to
connect to the server.". I tried disabling Firewall alltogether but to
no avail (i.e., i disabled the firewall but it didn't make a
difference).
Any ideas?
A.