How can I send image or pictures through email not as an attachment, as an body message (Outlook)

4 views (last 30 days)
Dear all,
I can send email through matlab and attach image files .
However, I couldn't find the way to send image or pictures in the message body so that I could easily check the pictures without download it.
I use outlook to email.
Could you let me know how can i solve this case?
Sincerely,
GY.

Accepted Answer

Walter Roberson
Walter Roberson on 24 Nov 2019
You will need to use HTML and code
<img src="data:
followed by a mime type and then base64 data.
  3 Comments
Walter Roberson
Walter Roberson on 25 Nov 2019
Ah, sorry, I just had a look at the sendmail() command, and I see that what you want to do is not possible with sendmail(). sendmail() can only send plain text in the body of the message, and any HTML would have to be an attachment, which you specifically do not want to do.
I am not sure what your alternatives are, short of opening a TCP connection to an SMTP port.
Gyuyoung Kim
Gyuyoung Kim on 25 Nov 2019
Thanks a lot!
I changed the way to send e-mails from sendmail to sendolmail so that I could use HTML code.
However the problem is that I have no idea how can i use "<img src="data:"
I just put the address of the file lilke "<img src=C:\~~~~~~>" but it just showed me x blank.
Please let me know if you know the way to use img src.
Sincerely,
GY.

Sign in to comment.

More Answers (0)

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!