# Ignition Edge sends emails but no attachments

**URL:** <https://forum.inductiveautomation.com/t/ignition-edge-sends-emails-but-no-attachments/111666>\
**Category:** Ignition\
**Tags:** ignition83, vision\
**Created:** [October 23, 2025, 2:51am UTC](https://forum.inductiveautomation.com/t/ignition-edge-sends-emails-but-no-attachments/111666 "2025-10-23T02:51:20Z")\
**Posts on this page:** 9\
**Page:** 2

<div class="post-metadata">

**Author:** ![marshall](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@marshall](https://forum.inductiveautomation.com/u/marshall)\
**Post date:** [October 28, 2025, 2:30am UTC](https://forum.inductiveautomation.com/t/ignition-edge-sends-emails-but-no-attachments/111666/21 "2025-10-28T02:30:30Z")

</div>

Mine is a little less legible. I might try some different email addresses/smtp Servers to see if i have any more luck

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/d/fd02af7c9ba15c9603a8ec1d3936baf8eb63ae5e.png)

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [October 28, 2025, 9:46am UTC](https://forum.inductiveautomation.com/t/ignition-edge-sends-emails-but-no-attachments/111666/22 "2025-10-28T09:46:19Z")

</div>

Are you really sending a text file or are you sending some type of rich text or binary encoded file? Can you view the source file in a plain text editor (such as Windows Notepad)? What is the source of the file?

---

<div class="post-metadata">

**Author:** ![marshall](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@marshall](https://forum.inductiveautomation.com/u/marshall)\
**Post date:** [October 28, 2025, 10:00am UTC](https://forum.inductiveautomation.com/t/ignition-edge-sends-emails-but-no-attachments/111666/23 "2025-10-28T10:00:29Z")

</div>

Its a text file .txt that I created in windows explorer. That screenshot is from windows notepad.

---

<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:** [October 28, 2025, 3:42pm UTC](https://forum.inductiveautomation.com/t/ignition-edge-sends-emails-but-no-attachments/111666/24 "2025-10-28T15:42:37Z")

</div>

What's the exact script you're using? Mangled data like that suggests a charset encoding/detection issue. If you're using `readFileAsBytes` and `attachmentData`, then that confusion isn't on Ignition's end, because we're treating the file as opaque bytes that won't be adjusted. Maybe try a different application or see if you can force Notepad to read it with a different content type 🤷

---

<div class="post-metadata">

**Author:** ![marshall](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@marshall](https://forum.inductiveautomation.com/u/marshall)\
**Post date:** [October 28, 2025, 9:18pm UTC](https://forum.inductiveautomation.com/t/ignition-edge-sends-emails-but-no-attachments/111666/25 "2025-10-28T21:18:29Z")

</div>

```python
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 = "ECS Email Profile Name"
   sender = "o ___r@en___ g.com.au"
   subject_mail = "Here is the file you requested"
   body_mail = "Hello, this is an email."
   recipients = ["m _____@____.com"]

   system.net.sendEmail(
   	smtpProfile = smtp_server, fromAddr = sender, 
   	subject = subject_mail, body = body_mail, html = 0, 
   	to = recipients, attachmentNames = [fileName], 
   	attachmentData = [fileData])

```

This is the script. The only extra information I can think that might make anything different  
-Using Ignition Edge 8.3.0  
-Have to and from both a M365 account and a Gmail account to send (both the same result)  
-Have run the script from a button on the vision editor rather than a separate client

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [October 28, 2025, 9:39pm UTC](https://forum.inductiveautomation.com/t/ignition-edge-sends-emails-but-no-attachments/111666/26 "2025-10-28T21:39:05Z")

</div>

Random thoughts:

- If it's a text file can you use [system.file.readFileAsString | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.3/appendix/scripting-functions/system-file/system-file-readFileAsString) rather than AsBytes?
- `if filePath != None:` can be reduced to  
`if filePath:`

---

<div class="post-metadata">

**Author:** ![marshall](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@marshall](https://forum.inductiveautomation.com/u/marshall)\
**Post date:** [October 28, 2025, 10:03pm UTC](https://forum.inductiveautomation.com/t/ignition-edge-sends-emails-but-no-attachments/111666/27 "2025-10-28T22:03:47Z")

</div>

Have given that a whirl too now. Still no luck. I might try from a different device with 8.1.x installed

---

<div class="post-metadata">

**Author:** ![marshall](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@marshall](https://forum.inductiveautomation.com/u/marshall)\
**Post date:** [October 28, 2025, 10:14pm UTC](https://forum.inductiveautomation.com/t/ignition-edge-sends-emails-but-no-attachments/111666/28 "2025-10-28T22:14:18Z")

</div>

8.1.x Works perfectly…..  
Might need to lodge a ticket to the mothership

---

<div class="post-metadata">

**Author:** ![marshall](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@marshall](https://forum.inductiveautomation.com/u/marshall)\
**Post date:** [December 23, 2025, 8:17pm UTC](https://forum.inductiveautomation.com/t/ignition-edge-sends-emails-but-no-attachments/111666/29 "2025-12-23T20:17:26Z")

</div>

In summary, Everything works on 8.1, but not on 8.3. IA are looking into and I will post here once that is resolved.

[Previous page](https://forum.inductiveautomation.com/t/ignition-edge-sends-emails-but-no-attachments/111666.md?page=1)
