Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help on Email macro

Hi all,

I am trying this macro to send simple test email. I am getting error at line indicated with Green text.

SMTP server details working when I configured automatic email(Alert Wizard)


Please help. Its Urgent


Thank you


CODE:

function SendTestMail()

Set objMsg = CreateObject("CDO.Message")

Set msgConf =objMsg.Configuration

'Server Configuration

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

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

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

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

msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "shweta.sawant@lntebg.com" 'type your mail id

msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "*******" 'Type your acccount Password

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

'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)

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

msgConf.Fields.Update

'End With

objMsg.To = "shweta.sawant@lntebg.com" ' type to mail id

objMsg.From = "TechCenter@lntebg.com" 'type from mail id

objMsg.Subject = "Test mail"

objMsg.HTMLBody = "QlikView Test Mail"

'objMsg.AddAttachment "D:\Image.jpg"

'Msg.AddAttachment filepath    ' Attachement object

objMsg.Sender = "L&T"

Set objMsg.Configuration = msgConf

objMsg.Send 

Set objFlds = Nothing

Set objConf = Nothing

Set objEmail = Nothing

Msgbox "Email Sent Successfully"

End function

3 Replies
vikasmahajan

Hope this helps you.

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
Not applicable
Author

Hey Vikas,

Thanks for help. But I am using Qlikview 11 personal edition.

vikasmahajan

You need to check the same I don't have IDEA whether the same will work in PE.

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.