Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

E-mail sending not working ( The message could not be sent to the SMTP server. The transport error code was 0x80040217)

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

' Email

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

11 Replies
Anonymous
Not applicable
Author

Thanks Parul. It's Work.

Anonymous
Not applicable
Author

Hi Staffan,

I allow system access also & gave also valid address but unfortunately it can't work.

Many Thanks!! for support..