Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Now accepting applications for the Qlik Luminary and Partner Ambassador Programs: Apply by July 6!
cancel
Showing results for 
Search instead for 
Did you mean: 
keerthika
Creator II
Creator II

SMTP Mail setting

Hi All,

I need to send mail using macro i Used below 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") = "******@gmail.com"

msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "***********"

msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = true

msgConf.Fields.Update

' Email

objMsg.To = "test@gmail.com"

objMsg.From = "test@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

Error: The transport failed to connect to the server.

How to check smtp configuration is set in qlikview?

Labels (1)
2 Replies
keerthika
Creator II
Creator II
Author

Hi All,


Is there a must need of Nprinting when we use macro to send email

Miguel_Angel_Baeyens
Employee
Employee

You are creating the entire mail object on the macro, so it will work or not work regardless the setup in Qlik. For QlikView tasks, check the QMC > System > Setup > Mail Server.

For NPrinting 16 check QlikView NPrinting Server > E-mail Settings.

For NPrinting 17 check Web Console > Admin > Email Settings

Remember that as in your previous post, if 2 step verification is enabled, you will need to create an app password in the Google Account settings: https://support.google.com/accounts/answer/185833?hl=en