I have programs that run on a scheduler and email reports each morning. We currently using are testing moving to an Azure server in the cloud. The following code runs in our current environment but when running it on the Azure server in give the error shown below. I am beginning the trouble shooting process to get these programs running on Azure.
Code:
Dim cdoConfig
Dim msgOne
Dim strAttachment As String
Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPServer) = "Testing-com.mail.protection.outlook.com"
.Update
End With
Set msgOne = CreateObject("CDO.Message")
With msgOne
Set .Configuration = cdoConfig
.To = "bob@rsghi.com"
.From = "bobrsghi@outlook.com"
.Subject = "Test Email"
.TextBody = "This is a test email."
.Send
End With
Error:
Run-time error ‘-2147220973 (80040213)’:
The transport failed to connect to the server