Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Export and Send Email

Hi,

I have a question about sending object via email from qlikview.

I've follow this thread Exporting and Sending Objects via Email

when i run the macro the export function runs perfectly, but the email not sent to the receiver.

This is the macro script

Sub ExportEmail

//Export the qlikview sheet as image to predestined location
Set obj = ActiveDocument.ActiveSheet
obj.ExportBitmapToFile "C:\\TestImageJPG.jpg"
MsgBox "Exported"
//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") = "senders email address"
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password of your account"
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1
msgConf.Fields.Update
' Email
objMsg.Subject = "Export & Import"
objMsg.To = "receivers email address"
objMsg.From = "senders email address"
objMsg.HTMLBody = "<html><body>Embedded Image:<br><img src=""E:\\TestImageJPG.jpg""></body></html>"
Set objMsg.Configuration = msgConf
' Send
objMsg.Send
Msgbox("Email Sent")
' Clear
Set objMsg = nothing
Set msgConf = nothing
End Sub


Do you know how to solve it ? is it any mistakes in the server configuration. I'm using gmail to send the email.


Thanks, really appreciate your help.

0 Replies