Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
While using the below code i can able to send a e-mail from Qlikview.
Here i'm trying to do more modifications like now in mail i want to add some body content & signature for the e-mail.
While using the below marco code i can able to achieve the Blue code stuff.. but i'm not able to achieve the red code stuff ..
Help on this..
Qlikview Macro Code:
sub mSendMail
Dim objOutlk 'Outlook
Dim objMail 'Email item
Dim strMsg
dim strMailTo
dim sString
dim oldFormat
Dim Rng
Const olMailItem = 0
Const CdoReferenceTypeName = 1
Set objOutlk = CreateObject("Outlook.Application")
Set objMail = objOutlk.createitem(olMailItem)
Set Rng = Nothing
objMail.To = "abc@xyz.com"
objMail.subject = "Today Dashboard" & Date()
ActiveDocument.ActiveSheet.CopyBitmapToClipboard true
ActiveDocument.GetSheetObject("CH86").ExportBitmapToFile "C:\User\Dashobard.jpeg"
objMail.attachments.add("C:\User\Dashobard.jpeg")
objMail.body ="Please find the Today Dashboard"
strMsg = "This is an automatic generated email from QlikView for Dashobard."
objMail.body = strMsg
objMail.HTMLBODY = "<HTML><BODY><img align=baseline border=0 hspace=10 src='cid:C:\User\Dashobard.jpeg'</BODY></HTML>"
objMail.Send
Set objMail = Nothing
Set objOutlk = Nothing
'Msgbox " Mail delivered"
end sub
Expected output in the E-mail
To:abc@xyz.com
CC:cdf@xyz.com
Subject: todays dashboard.
E-mail body : Hi, Please find the todays dashboard in the attachments.
IMAGE
Email-Signature
Thanks & Regards,
Venkata Sreekanth
It is a very old post but I hope it helps someone, this syntax work for me:
objMail.HTMLBODY = "<HTML><BODY><p align='CENTER'><img src='C:\User\Dashobard.jpeg' width=600 height=450 border=0><br></p></BODY></HTML>"
All the body must be in HTML code so remove objMail.body
Please, How did you set up Outlook SMTP in your QlikView?