# Report not sending with system.report.executeAndDistribute

**URL:** <https://forum.inductiveautomation.com/t/report-not-sending-with-system-report-executeanddistribute/74147>\
**Category:** Ignition\
**Tags:** scripting, ignition81\
**Created:** [May 24, 2023, 7:41pm UTC](https://forum.inductiveautomation.com/t/report-not-sending-with-system-report-executeanddistribute/74147 "2023-05-24T19:41:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christopher\_Lang](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/christopher_lang/32/55614_2.png) [@Christopher\_Lang](https://forum.inductiveautomation.com/u/Christopher_Lang)\
**Post date:** [May 24, 2023, 7:41pm UTC](https://forum.inductiveautomation.com/t/report-not-sending-with-system-report-executeanddistribute/74147/1 "2023-05-24T19:41:08Z")

</div>

Hello I am trying to use a mouseClicked event Handler to execute and send a report by email but I can't seem to get it to do anything when the button is clicked

this is my code  
system.report.executeAndDistribute(path="Tallow pumps", project="Copy\_Of\_Joslin\_test\_CJL", action= "email",  
actionSettings = {"to":['christopher.lang2@tyson.com'], "smtpServerName":"10.16.1.86", "[from":"reporting@myplant.com](mailto:from%22:%22reporting@myplant.com)", "subject":"Production Report"})

any ideas would be helpful

---

<div class="post-metadata">

**Author:** ![Brandon\_Peterson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brandon_peterson/32/32960_2.png) [@Brandon\_Peterson](https://forum.inductiveautomation.com/u/Brandon_Peterson)\
**Post date:** [May 24, 2023, 7:50pm UTC](https://forum.inductiveautomation.com/t/report-not-sending-with-system-report-executeanddistribute/74147/2 "2023-05-24T19:50:13Z")

</div>

Here are a few places to get started:

1. Wrap your code in a try-catch block and print out any errors you might be getting.
2. Make sure your `smtpServerName` is set to the name of your email server, not the IP address.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/e/ce457d7bc085d64cba9002ee9e2c0d927d1916be.png)

---

<div class="post-metadata">

**Author:** ![Christopher\_Lang](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/christopher_lang/32/55614_2.png) [@Christopher\_Lang](https://forum.inductiveautomation.com/u/Christopher_Lang)\
**Post date:** [May 24, 2023, 7:55pm UTC](https://forum.inductiveautomation.com/t/report-not-sending-with-system-report-executeanddistribute/74147/3 "2023-05-24T19:55:01Z")

</div>

the name of the smtpServerName was the problem thank you
