Rank: Newbie
Groups: Registered
Joined: 2/17/2020(UTC) Posts: 0
Hi, I have purchased the SMTP Component to use with VBA/Excel. BTW - haven't found much documentation on what the bodyFormat property; would like to see more. We have about 5 charts in Excel that we want to paste into an email and send out periodically using VBA. I'm guessing I need to somehow convert these to html but I'm not sure how to go about it. Can you please provide some guidance? Thank you, Topher
Rank: Newbie
Groups: Registered
Joined: 2/17/2020(UTC) Posts: 0
So I got it to export the charts as images...
Sheets(1).ChartObjects("Chart 1").Chart.Export "C:\Chart1.png" Then I build some HTML...
myHTML = "<!DOCTYPE html><html><body>" myHTML = myHTML & "<img src='c:\Chart1.png'>" myHTML = myHTML & "</body></html>" Then I use...
SendMailTo(me, myself, andi@i.com , "Does this work?", myHTML, 1) And it sends....
And in Gmail I get blank email. And it I look at everything, it has the <img src='c:\Chart1.png'> lines in what was received.
Where am I going wrong?
Edited by user Monday, February 17, 2020 1:47:48 PM(UTC)
| Reason: code snippets are not actual - redacted to protect the innocent.
Rank: Administration
Groups: Administrators
Joined: 11/11/2010(UTC) Posts: 1,154
Thanks: 9 times Was thanked: 55 time(s) in 55 post(s)
Originally Posted by: congtop So I got it to export the charts as images...
Sheets(1).ChartObjects("Chart 1").Chart.Export "C:\Chart1.png" Then I build some HTML...
myHTML = "<!DOCTYPE html><html><body>" myHTML = myHTML & "<img src='c:\Chart1.png'>" myHTML = myHTML & "</body></html>" Then I use...
SendMailTo(me, myself, andi@i.com , "Does this work?", myHTML, 1) And it sends....
And in Gmail I get blank email. And it I look at everything, it has the <img src='c:\Chart1.png'> lines in what was received.
Where am I going wrong?
If you want to import linked image as embedded images, please change this line:
Code:
oSmtp.BodyText = body
' to
oSmtp.ImportHtml body, "c:"
' c: is the base path of your image if relative path is used in your html source, because you used full path
' you can input any value here.
Forum Jump
EmailArchitect Support
Email Component Development
- EASendMail SMTP Component - .NET Version
- EASendMail SMTP Component - Windows Store Apps
- EASendMail SMTP ActiveX Object
- EAGetMail POP3 & IMAP4 Component - .NET Version
- EAGetMail POP3 & IMAP4 ActiveX Object
Exchange Server and IIS SMTP Plugin
- DomanKeys/DKIM for Exchange Server and IIS SMTP
- Disclaimer and S/MIME for Exchange Server and IIS
EmailArchitect Email Server
- EmailArchitect Email Server (General)
- EmailArchitect Email Server Development
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.