For at least 10 years until recently, I've been successfully sending emails through SMTP, by using a simple VBScript with CDO.Message.
Set emailObj = CreateObject("CDO.Message")
emailObj.From = "[email protected]>"
emailObj.To = "[email protected]"
emailObj.Subject = "Test Email"
emailObj.TextBody = "This is a SMTP test email."
Set emailConfig = emailObj.Configuration
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp-mail.outlook.com"
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 587
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "[email protected]"
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "mypassword"
emailConfig.Fields.Update
emailObj.Send
However with a new test, I notice that no SMTP of widely used email providers works anymore (Yahoo, GMail, Hotmail, Mail.com, Yandex).
For all of them I get the error message:
The transport failed to connect to the server
To be sure it wasn't a problem from my end, I tested from many computers, countries and accounts. I've been testing with the officially provided SMTP details and ports 25, 465, 587. No luck with any of them.
The code still works successfully with the SMTP of my own company and our webhosting SMTP.
We distribute the software to our customers, and we don't want them to be dependent on our own SMTP to relay their mail. They should be able to easily setup their personal email accounts on our software. It used to be as easy as checking their own email provider website and entering the provided SMTP details. However, nowadays such a trivial tasks seems to have become impossible.
Am I missing something here, is it still possible to use the SMTP of widely used email providers using Visual Basic Script and CDO?
Here is a list of common email providers and their methods.
I just don't see how VBScript can do this in 10 lines of code.