# system.net.sendEmail with optional attachment

**URL:** <https://forum.inductiveautomation.com/t/system-net-sendemail-with-optional-attachment/111983>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [November 6, 2025, 7:20am UTC](https://forum.inductiveautomation.com/t/system-net-sendemail-with-optional-attachment/111983 "2025-11-06T07:20:50Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [November 6, 2025, 7:31am UTC](https://forum.inductiveautomation.com/t/system-net-sendemail-with-optional-attachment/111983/2 "2025-11-06T07:31:34Z")

</div>

> [@Ignition Edge sends emails but no attachments](https://forum.inductiveautomation.com/t/ignition-edge-sends-emails-but-no-attachments/111666/14):
>
> This works for me, albeit I didn’t test on Edge; filePath = system.file.openFile() if filePath != None: # This gets the filename without the C:\folder stuff fileName = filePath.split("\\")[-1] fileData = system.file.readFileAsBytes(filePath) smtp\_server = "test" sender = "test" subject\_mail = "Here is the file you requested" body\_mail = "Hello, this is an email." recipients = ["test"] system.net.sendEmail( smtpProfile = smtp\_server, fromAddr = sender, sub…

---

_[View the full topic](https://forum.inductiveautomation.com/t/system-net-sendemail-with-optional-attachment/111983)._
