Failure to connect to Zoho SMTP when trying to send an email using VBA
I am trying to use VBA from Excel to send an email.
I think I have all the correct settings, but I get the error:
"The server rejected the sender address. The server response was: -ERR USER NOT AUTHENTICATED"
This tells me that a connection WAS made to the server and that the SMTP server decided not to allow that user in.
The username and password I have used work when I log into zoho, and I have checked and re-checked the code to make sure I did not make username or pw mistake.
This a copy of the relevant code is: (I have starred out my pw and username, but they are correct)
Set CDO_Config = CreateObject("CDO.Configuration")
CDO_Config.Load -1
Set SMTP_Config = CDO_Config.Fields
With SMTP_Config
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "*********@************.com"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "**************"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
'please put your server name below
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.zoho.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
.Update
End With
With CDO_Mail_Object
Set .Configuration = CDO_Config
End With
Any ideas why it does not work?
-MOE-