congtop
  • congtop
  • 51.5% (Neutral)
  • Newbie Topic Starter
5 years ago
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
congtop
  • congtop
  • 51.5% (Neutral)
  • Newbie Topic Starter
5 years ago
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 = ""
myHTML = myHTML & ""
myHTML = myHTML & ""


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 lines in what was received.

Where am I going wrong?
ivan
  • ivan
  • 100% (Exalted)
  • Administration
5 years ago

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 = ""
myHTML = myHTML & ""
myHTML = myHTML & ""


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 lines in what was received.

Where am I going wrong?

Originally Posted by: congtop 



If you want to import linked image as embedded images, please change this line:

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.
Users browsing this topic

    EXPLORE TUTORIALS

    © All Rights Reserved, AIFEI Software Limited & AdminSystem Software Limited.