Hi all,
Wonder if anyone can give input why I am getting an error, or what may have changed.
I have been using the code below in Microsoft Access DB for years to connect to smtp.office365.com and send emails.
Out of the blue, around 4 weeks ago, I started receiving an error: "transport failed to connect to the server" Error -2147220973
Nothing had changed. I can login to Office 365 with the username and password I use (disguised below). I have also tried my team members username and passwords too.
I have the same error working on my laptop at work, and my desktop at home.
My team members have also experienced the same error.
I have tried different ports e.g., 25 / 465 / 587
The script works perfectly if I use the smtpserver of a webhosting company that hosts our website, e.g., gvam1287.siteground.biz
Microsoft tells me that they will not assist with custom code.
They tell me that smtp.office365.com is working perfectly and that cannot be the fault.
Anyone have any ideas or experienced the same problem?
Wonder if anyone can give input why I am getting an error, or what may have changed.
I have been using the code below in Microsoft Access DB for years to connect to smtp.office365.com and send emails.
Out of the blue, around 4 weeks ago, I started receiving an error: "transport failed to connect to the server" Error -2147220973
Nothing had changed. I can login to Office 365 with the username and password I use (disguised below). I have also tried my team members username and passwords too.
I have the same error working on my laptop at work, and my desktop at home.
My team members have also experienced the same error.
I have tried different ports e.g., 25 / 465 / 587
The script works perfectly if I use the smtpserver of a webhosting company that hosts our website, e.g., gvam1287.siteground.biz
Microsoft tells me that they will not assist with custom code.
They tell me that smtp.office365.com is working perfectly and that cannot be the fault.
Anyone have any ideas or experienced the same problem?
Code:
Function TestE()
Dim objMessage
Set objMessage = CreateObject("CDO.Message")
With objMessage
.Configuration.Load -1 ' CDO Config
.To = "joeblogs@zzzz.com"
.From = "susanblogs@zzzy.com"
.Subject = "Test Email"
.TextBody = "This is a test email sent using CDO."
' SMTP Configuration
With .Configuration.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") = 465 ' 587 / 25
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = MyUserName
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = MyPassword
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Update
End With
' Send the email
.Send
End With
Set objMessage = Nothing
MsgBox "done"
End Function