# Embed image in html email using system.net.sendEmail

**URL:** <https://forum.inductiveautomation.com/t/embed-image-in-html-email-using-system-net-sendemail/107061>\
**Category:** Ignition\
**Created:** [June 4, 2025, 11:29pm UTC](https://forum.inductiveautomation.com/t/embed-image-in-html-email-using-system-net-sendemail/107061 "2025-06-04T23:29:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://forum.inductiveautomation.com/u/Jonathan)\
**Post date:** [June 4, 2025, 11:29pm UTC](https://forum.inductiveautomation.com/t/embed-image-in-html-email-using-system-net-sendemail/107061/1 "2025-06-04T23:29:39Z")

</div>

Is it possible to send an email using system.net.sendEmail that will be HTML and have the attached image embedded in the body of the email? If so does someone have an example? I see in the documentation there was some support for MIME, but the examples do not go into detail about how it works or how to use it.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 4, 2025, 11:42pm UTC](https://forum.inductiveautomation.com/t/embed-image-in-html-email-using-system-net-sendemail/107061/2 "2025-06-04T23:42:41Z")

</div>

I would be surprised if you can get this to work within the boundaries of our scripting functions, but it would probably be possible to write a script to run on the gateway that accesses the underlying Java mail APIs and does this for you.

---

<div class="post-metadata">

**Author:** ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://forum.inductiveautomation.com/u/Jonathan)\
**Post date:** [June 4, 2025, 11:52pm UTC](https://forum.inductiveautomation.com/t/embed-image-in-html-email-using-system-net-sendemail/107061/3 "2025-06-04T23:52:09Z")

</div>

Well, I did have it working 7.9 using smtplib and email, but for some reason in 8.1 when I go to use smtp sendmail and the file is over 56 kb it times out. still works perfectly fine in 7.9 against the same email server. I was hoping there was native support for embedded images.

I tried importing javax.mail but is says there is no module named mail. I am on 8.1.32

---

<div class="post-metadata">

**Author:** ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://forum.inductiveautomation.com/u/Jonathan)\
**Post date:** [June 5, 2025, 12:46am UTC](https://forum.inductiveautomation.com/t/embed-image-in-html-email-using-system-net-sendemail/107061/4 "2025-06-05T00:46:47Z")

</div>

Just caught that you said on the gateway. I just tried importing javax.mail from with the gateway scope and that works. I will give that a try.
