Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Email sending not working

Why this this function not working?

function sending()
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Subject"
objMessage.From = "test1@gmail.com"
objMessage.To = "test2@gmail.com"

objMessage.TextBody = "Body"

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"


objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername ") ="test1@gmail.com"

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword ") ="password"

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465

objMessage.Configuration.Fields.Update

objMessage.Send
end function

32 Replies
Not applicable
Author

Still m getting this error "The transport failed to connect to the server"

at line objMsg.send

michaelfreitas
Creator
Creator

The code is perfect but it did not work on my computer! The ping the smtp.gmail.com address did not respond.

Ran ping from another computer and it worked perfectly   and also sent the email.

Conclusion: The problem was between my computer and the rest of the world.


thanks,

Not applicable
Author

Hi ,

I am getting error "The message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available "   on code line objMsg.Send

Please help me

thanks,

Kapil

Sub SendGMail1()

' 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") = 465
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "kapil_dadheech@gmail.com"
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "kapil1"
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1

msgConf.Fields.Update

' Email
objMsg.To = "kapil_dadheech@gmail.com"
objMsg.From = "kapil_dadheech@gmail.com"
objMsg.Subject = "Test send with Gmail account"
objMsg.HTMLBody = "HTML/Plain text message."
objMsg.Sender = "Mr. Name"

Set objMsg.Configuration = msgConf

' Send
objMsg.Send

' Clear
Set objMsg = nothing
Set msgConf = nothing

End Sub

Anonymous
Not applicable
Author

Hi,

I am also getting the same error

"The transport failed to connect to the server"

at line objMsg.send.

I searched for it but unable to find the possible solution.

Did you resolve the error?

If yes,please help me .

Thanks,

Geeta

Anonymous
Not applicable
Author

Hi,

I got the solution.

It is resolved by changing the server port from 465 to 25.

Thanks,

Geeta

Not applicable
Author

can you help me that how can i know my port location.. becuase 25 is also not working

Anonymous
Not applicable
Author

Hi,

You can check the server Port location by going to account settings of your mail client.

Thanks,

Geeta

Not applicable
Author

Hi ,

 

I am getting error "The message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available "   on code line objMsg.Send

Please help me

thanks,

Kapil

Sub SendGMail1()

' 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") = 465
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "kapil_dadheech@gmail.com"
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "kapil1"
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1

msgConf.Fields.Update

' Email
objMsg.To = "kapil_dadheech@gmail.com"
objMsg.From = "kapil_dadheech@gmail.com"
objMsg.Subject = "Test send with Gmail account"
objMsg.HTMLBody = "HTML/Plain text message."
objMsg.Sender = "Mr. Name"

Set objMsg.Configuration = msgConf

' Send
objMsg.Send

' Clear
Set objMsg = nothing
Set msgConf = nothing

End Sub

Not applicable
Author

Hola!

me funciona correctamente, manda el mail sin problemas.

He añadido esto para que mande un adjunto:

objMsg.AddAttachment "C:\qliksense\tabla.xls"

Y también lo manda sin problema pero ahora necesito que en el cuerpo del mail se "escriba" la tabla de QlikView que yo quiera, no que sea un adjunto. Alguien me ayuda por favor?? gracias!

----

Hi!

It works correctly , sends the mail without problems.

I added this to send an attachment :

objMsg.AddAttachment "C:\qliksense\tabla.xls"

And it works too but now I need to "type"/"insert" into mail's body  QlikView table that I want, not attachment.

Someone please help me ?? Thank you !

Not applicable
Author

Hello I try the code on the server I'm not getting an error, but did not send me e-mail to my account in Gmiil

I use my password and email