Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
I am getting an error "The message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available" on on code line 'objMsg.Send'.
Below is my Code:
Sub SendGmail()
' Object creation
Set objMsg = CreateObject("CDO.Message")
Set msgConf = CreateObject("CDO.Configuration")
' Server Configuration
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "satyendrabelwanshi805@gmail.com"
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "satyendrab@z45"
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1
msgConf.Fields.Update
objMsg.To = "sumantdiwakar@gmail.com"
objMsg.From = "satyendrabelwanshi805@gmail.com"
objMsg.Subject = "Test send with gmail account"
objMsg.HTMLBody = "Hello!!"
objMsg.Sender = "Mr. Satyendra"
Set objMsg.Configuration = msgConf
' Send
objMsg.Send
' Clear
Set objMsg = nothing
Set msgConf = nothing
End Sub
*****
Thanks for your help & support
Satyendra
Thanks Parul. It's Work.
Hi Staffan,
I allow system access also & gave also valid address but unfortunately it can't work.
Many Thanks!! for support..