Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sending reports to a specified email id through macro

Hello Friends,

Kindly, if possible can I have some vb-script macro code examples to send a report from my desktop application to  a specified email address??

Regards,

Kiru

3 Replies
Not applicable
Author

Hi

its possible but i dont have it right now try in community u will get here

Not applicable
Author

Hi ,

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") = 465  

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

msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "user@gmail.com"  

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

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

msgConf.Fields.Update  

 

' Email  

objMsg.To = "user@gmail.com"  

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

  1. End Sub 
ashfaq_haseeb
Champion III
Champion III

Hi,

Check this

Regards

ASHFAQ