Sending Images in a HTML Body of an email

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Shadow3641
Junior Coder
Posts: 26
Joined: Thu Nov 17, 2016 2:45 pm

Sending Images in a HTML Body of an email

Post by Shadow3641 » Wed Dec 13, 2017 5:09 pm

Hello, I was wondering if there is a way to send an image in the Body of an HTML email using the SMTPSendMail command? The main reason behind this is the signature that I normally use has my logo in it.

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Sending Images in a HTML Body of an email

Post by Marcus Tettmar » Thu Dec 14, 2017 4:42 pm

Yes, have a look at the manual:
https://www.mjtnet.com/manual/index.htm ... ndmail.htm
To send HTML set SMTP_HTMLBODY to 1.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Shadow3641
Junior Coder
Posts: 26
Joined: Thu Nov 17, 2016 2:45 pm

Re: Sending Images in a HTML Body of an email

Post by Shadow3641 » Thu Dec 14, 2017 6:09 pm

Yes, I have done that but how do you load it into the code?

Code: Select all


Let>SMTP_HTMLBODY=1
Let>body=Let me know if you have any questions or comments. <-- {insert picture here type deal}
SMTPSendMail>email,server,email,Name,This is a test,%body%,


User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Sending Images in a HTML Body of an email

Post by Marcus Tettmar » Thu Dec 14, 2017 6:57 pm

This is an HTML question. This isn't the place for an HTML tutorial, but ...

First your image will need to be somewhere public. You could use dropbox or similar. Then:

Code: Select all

Let me know if you have any questions or comments. <img src="http://someplace.com/files/myimage.png">
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Shadow3641
Junior Coder
Posts: 26
Joined: Thu Nov 17, 2016 2:45 pm

Re: Sending Images in a HTML Body of an email

Post by Shadow3641 » Thu Dec 14, 2017 7:57 pm

Ah ok, I see sorry about that I should have caught on to that you could just put HTML code right into the body.

Thanks again Marcus

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts