Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

sending mail via QV

Hi,

Is it possible to send a mail,when the qvw file is reloaded?

Thanks in advance

1 Solution

Accepted Solutions
krishna20
Valued Contributor

Re: sending mail via QV

HI ,

Please find the below code in macros.It may helpful

  1. Sub SendGMail()  
  2.  
  3. ' Object creation  
  4. Set objMsg = CreateObject("CDO.Message")  
  5. Set msgConf = CreateObject("CDO.Configuration")  
  6.  
  7. ' Server Configuration  
  8. msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2  
  9. msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"  
  10. msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465  
  11. msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1  
  12. msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "user@gmail.com"  
  13. msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"  
  14. msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1  
  15. msgConf.Fields.Update  
  16.  
  17. ' Email  
  18. objMsg.To = "user@gmail.com"  
  19. objMsg.From = "fromuser@domain.com"  
  20. objMsg.Subject = "Test send with Gmail account"  
  21. objMsg.HTMLBody = "HTML/Plain text message."  
  22. objMsg.Sender = "Mr. Name"  
  23.  
  24. Set objMsg.Configuration = msgConf  
  25.  
  26. ' Send  
  27. objMsg.Send  
  28.  
  29. ' Clear  
  30. Set objMsg = nothing  
  31. Set msgConf = nothing 
  32.  
  33. End Sub 

Regards

Krishna

4 Replies
qlikview0585
New Contributor

Re: sending mail via QV

Hi,

Yes, it is possible.

In the main menu, go to Tools-Alerts and there you can set various options for sending an email/alert.

Hope this helps!

krishna20
Valued Contributor

Re: sending mail via QV

HI ,

Please find the below code in macros.It may helpful

  1. Sub SendGMail()  
  2.  
  3. ' Object creation  
  4. Set objMsg = CreateObject("CDO.Message")  
  5. Set msgConf = CreateObject("CDO.Configuration")  
  6.  
  7. ' Server Configuration  
  8. msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2  
  9. msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"  
  10. msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465  
  11. msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1  
  12. msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "user@gmail.com"  
  13. msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"  
  14. msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1  
  15. msgConf.Fields.Update  
  16.  
  17. ' Email  
  18. objMsg.To = "user@gmail.com"  
  19. objMsg.From = "fromuser@domain.com"  
  20. objMsg.Subject = "Test send with Gmail account"  
  21. objMsg.HTMLBody = "HTML/Plain text message."  
  22. objMsg.Sender = "Mr. Name"  
  23.  
  24. Set objMsg.Configuration = msgConf  
  25.  
  26. ' Send  
  27. objMsg.Send  
  28.  
  29. ' Clear  
  30. Set objMsg = nothing  
  31. Set msgConf = nothing 
  32.  
  33. End Sub 

Regards

Krishna

Not applicable

Re: sending mail via QV

Helpful post!

alexantone
Contributor

Re: sending mail via QV

A very good altenative of sending alert /mail

However you must allowed scripting on Qlikview Server

Community Browser