HKFuey
asked on
VBA Office 365 "The transport failed to connect to server"
VBA Send Mail using Office 365
Followed this article https://www.tachytelic.net /2018/12/e mail-vbscr ipt-vba-of fice-365/
Getting "The transport failed to connect to server" Can anyone help?
Followed this article https://www.tachytelic.net
Dim objMessage, objConfig, Fields
Set objMessage = CreateObject("CDO.Message")
Set objConfig = CreateObject("CDO.Configuration")
Set Fields = objConfig.Fields
With Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.office365.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = "587"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "xxxxx@xxxxx"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "xxxxxx"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
.Update
End With
Set objMessage.Configuration = objConfig
With objMessage
.Subject = "Test Msg"
.from = "x@xcom"
.To = "y@gmail.com"
objMessage.Send
DoCmd.Close
End With
Getting "The transport failed to connect to server" Can anyone help?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for your input
Glad you got that to work.
»bp
»bp
One obvious thing you need to determine is that your organization or internet ISP does not block outgoing connections on port 25 ot 587. Some do that.
Beyond that I did find these two posts that you may want to follow up on, they weren't enough for me to be able to figure out a working solution.
Sorry I don't have more to offer, if you get it working be sure and post back here.
»bp