# \[IGN-14996\]8.3 net.sendEmail attachments not functioning as expected

**URL:** <https://forum.inductiveautomation.com/t/ign-14996-8-3-net-sendemail-attachments-not-functioning-as-expected/112427>\
**Category:** Ignition\
**Created:** [November 25, 2025, 5:22pm UTC](https://forum.inductiveautomation.com/t/ign-14996-8-3-net-sendemail-attachments-not-functioning-as-expected/112427 "2025-11-25T17:22:43Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![cdunn.home](https://avatars.discourse-cdn.com/v4/letter/c/45deac/32.png) [@cdunn.home](https://forum.inductiveautomation.com/u/cdunn.home)\
**Post date:** [November 25, 2025, 5:22pm UTC](https://forum.inductiveautomation.com/t/ign-14996-8-3-net-sendemail-attachments-not-functioning-as-expected/112427/1 "2025-11-25T17:22:43Z")

</div>

This code worked fine in 8.1, but now I get PDFs I can’t open. Or JPEGs or PNGs.

In the code below, I am creating a PDF byte array from system.report.executeReport(). For troubleshooting, I am also saving the file as a PDF.

```python
reportResult = system.report.executeReport(
                              path=reportName, 
                              project = projectName, 
                              parameters = params, 
                              fileType = "pdf")
    
system.file.writeFile(r"E:\Downloads\Projects\ReportTest\testfile.pdf", reportResult)

system.net.sendEmail(
            fromAddr = "Press10Site@customer.com",
            subject = "Press 10 Site Alarm Frequency Report",
            to = toList,
            html = False,
            body = "File type = {0}".format(type(reportResult)),
            attachmentNames = ["MyFile.pdf"],
            attachmentData = [reportResult],
            smtpProfile = "customerSMTP"
            )

```

When I get the email, the “pdf” file attached gives me this:

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/7/676741b486501540a48838362e1200439849cf0d.png)

Meanwhile, the file that was saved gives me a good pdf file. Likewise, using the Report’s integral email scheduler, I get the same good PDF file.

Because I can save the file and open as PDF, I know it isn’t the report.executeReport() that is going wrong.

Because I can email the file from other IGN utilities (Report’s Integral Scheduler), I don’t think my company’s email, or the customer’s company’s email are doing bad things to attachments.

That would seem to leave system.net.sendEmail() as the prime suspect, I’m afraid. I reiterate: this is code I have been using in 8.1 that has worked well and this is my first time working on 8.3, though I did not see any real changes to net.sendEmail from 8.1 to 8.3 in the docs.

Caveat: I am a good try-er, but this GW is owned by the customer and they have their own dedicated and competent team of IGN managers, and therefore they have the final say over any testing _ **that would require admin access** _.

Anyone else experience this? Any ideas?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 25, 2025, 5:34pm UTC](https://forum.inductiveautomation.com/t/ign-14996-8-3-net-sendemail-attachments-not-functioning-as-expected/112427/2 "2025-11-25T17:34:25Z")

</div>

I bet this is just a bug we introduced during the overhaul of how RPC works...

if you called `system.net.sendEmail` with the same attachment data but from _gateway scope_, e.g. from a tag event script or gateway timer script or something, I suspect it would work.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 25, 2025, 5:38pm UTC](https://forum.inductiveautomation.com/t/ign-14996-8-3-net-sendemail-attachments-not-functioning-as-expected/112427/3 "2025-11-25T17:38:00Z")

</div>

Even if I'm right, you should call support and let them take a look. If it's broken they'll reproduce and confirm before making a ticket. I can't create a bug ticket based on my 30 second dive and a WAG about what might be wrong.

---

<div class="post-metadata">

**Author:** ![cdunn.home](https://avatars.discourse-cdn.com/v4/letter/c/45deac/32.png) [@cdunn.home](https://forum.inductiveautomation.com/u/cdunn.home)\
**Post date:** [November 25, 2025, 5:38pm UTC](https://forum.inductiveautomation.com/t/ign-14996-8-3-net-sendemail-attachments-not-functioning-as-expected/112427/4 "2025-11-25T17:38:30Z")

</div>

Easy enough to test! More info in a moment…

---

<div class="post-metadata">

**Author:** ![cdunn.home](https://avatars.discourse-cdn.com/v4/letter/c/45deac/32.png) [@cdunn.home](https://forum.inductiveautomation.com/u/cdunn.home)\
**Post date:** [November 25, 2025, 5:44pm UTC](https://forum.inductiveautomation.com/t/ign-14996-8-3-net-sendemail-attachments-not-functioning-as-expected/112427/5 "2025-11-25T17:44:08Z")

</div>

That worked. Thank you!

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 25, 2025, 5:45pm UTC](https://forum.inductiveautomation.com/t/ign-14996-8-3-net-sendemail-attachments-not-functioning-as-expected/112427/6 "2025-11-25T17:45:45Z")

</div>

Well, it's a workaround, and perhaps confirmation of my hunch, but not a real solution.

---

<div class="post-metadata">

**Author:** ![cdunn.home](https://avatars.discourse-cdn.com/v4/letter/c/45deac/32.png) [@cdunn.home](https://forum.inductiveautomation.com/u/cdunn.home)\
**Post date:** [November 25, 2025, 5:58pm UTC](https://forum.inductiveautomation.com/t/ign-14996-8-3-net-sendemail-attachments-not-functioning-as-expected/112427/7 "2025-11-25T17:58:06Z")

</div>

Luckily for me, I intended it for Gateway scope and using the script console to trigger the function was only for testing.

If it would still be helpful, I can still contact support and have them confirm whatever you’d need.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 25, 2025, 8:00pm UTC](https://forum.inductiveautomation.com/t/ign-14996-8-3-net-sendemail-attachments-not-functioning-as-expected/112427/8 "2025-11-25T20:00:51Z")

</div>

Well for posterity, my hunch is that the attachment data is gzipped and then base64 encoded on the client side but only base64 decoded once it reaches the gateway - the unzipping got lost somewhere in the RPC overhaul.

@paul-griffith

---

<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:** [November 25, 2025, 10:37pm UTC](https://forum.inductiveautomation.com/t/ign-14996-8-3-net-sendemail-attachments-not-functioning-as-expected/112427/9 "2025-11-25T22:37:02Z")

</div>

Yeah, sure looks that way. The respective encoding/decoding steps didn't change as part of RPC, but it looks like the way the code paths got collapsed ended up causing this. I'll get a ticket going internally.
