# Email : HTML Report

**URL:** <https://forum.inductiveautomation.com/t/email-html-report/110552>\
**Category:** Ignition\
**Tags:** perspective, scripting\
**Created:** [September 11, 2025, 7:18pm UTC](https://forum.inductiveautomation.com/t/email-html-report/110552 "2025-09-11T19:18:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samkcr](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@Samkcr](https://forum.inductiveautomation.com/u/Samkcr)\
**Post date:** [September 11, 2025, 7:18pm UTC](https://forum.inductiveautomation.com/t/email-html-report/110552/1 "2025-09-11T19:18:47Z")

</div>

Hi,

I have successfully converted the dataset to excel and sending that through Email this works fine. Now customer is expecting the Table should appear in the Email body itself. So I have used system.dataset.dataSetToHTML instead of [system.dataset.dataSetToExcel](https://www.docs.inductiveautomation.com/docs/deprecated/system-functions/system-dataset-deprecated/system-dataset-dataSetToExcel) to get the report. Now the HTML report is appearing as attachment but how to display this table in Body itself.

```python
data = Sql query data 
report_data = system.dataset.dataSetToHTML(1,data,"TurnOverReport")
body = report_data
recipients = "test@mamil.com"
system.net.sendEmail(smtpProfile="test@domain.com",fromAddr="test@domain.com",subject=subject,body=body,to= recipients)

```

What needs to be changed here?

---

<div class="post-metadata">

**Author:** ![Ryan\_Deardorff](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan_deardorff/32/63815_2.png) [@Ryan\_Deardorff](https://forum.inductiveautomation.com/u/Ryan_Deardorff)\
**Post date:** [September 11, 2025, 7:25pm UTC](https://forum.inductiveautomation.com/t/email-html-report/110552/2 "2025-09-11T19:25:44Z")

</div>

`sendEmail` has an `html` parameter you can set to true (though it’s supposed to auto-detect it), and you might be able to get that to work, but bear in mind it will probably greatly increase the chances of inbox filters treating it as spam. You may need potential recipients to add the sender to a whitelist.

---

<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:** [September 11, 2025, 7:34pm UTC](https://forum.inductiveautomation.com/t/email-html-report/110552/3 "2025-09-11T19:34:13Z")

</div>

Tip: Set your "from" email address to something that will help trace it to its source if it starts spamming or creating problems. Something like `scriptName.projectName@gatewayName.yourCompany.com` will be a huge help to IT, etc.

---

<div class="post-metadata">

**Author:** ![dillon](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dillon/32/81537_2.png) [@dillon](https://forum.inductiveautomation.com/u/dillon)\
**Post date:** [September 11, 2025, 7:45pm UTC](https://forum.inductiveautomation.com/t/email-html-report/110552/4 "2025-09-11T19:45:12Z")

</div>

I tried this once and because I didn’t do my company’s actual domain, it got reported for phishing a couple times 😃 (good on those employees, the trainings work!!)

Ended up keeping the company’s domain and all the needed info before the @

Great tip to share though! @Transistor

---

<div class="post-metadata">

**Author:** ![Samkcr](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@Samkcr](https://forum.inductiveautomation.com/u/Samkcr)\
**Post date:** [September 12, 2025, 6:20am UTC](https://forum.inductiveautomation.com/t/email-html-report/110552/5 "2025-09-12T06:20:58Z")

</div>

I need some additional info…

Now I am getting the HTML report in mail itself… this works If I want to change the color of the table column is there any possibility? I have to highlight some of the column data into different color

Example I am generating the shift data here I have a column name Line. So I want to differentiate the line name with color

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/9/199753ff0f846a16a465d9cc2e51826564b019b1.png)

---

<div class="post-metadata">

**Author:** ![sanjanakrishnamurthy](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@sanjanakrishnamurthy](https://forum.inductiveautomation.com/u/sanjanakrishnamurthy)\
**Post date:** [September 12, 2025, 8:10am UTC](https://forum.inductiveautomation.com/t/email-html-report/110552/6 "2025-09-12T08:10:38Z")

</div>

You cannot use system.dataset.dataSetToHTML(), if you want a formatted table. You’ll have to manually get the table data, apply formatting or styles (using classes and the style tag) through loops.
