# Unexpected behavior of email notifications

**URL:** <https://forum.inductiveautomation.com/t/unexpected-behavior-of-email-notifications/78440>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [August 28, 2023, 7:29am UTC](https://forum.inductiveautomation.com/t/unexpected-behavior-of-email-notifications/78440 "2023-08-28T07:29:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michal\_Goralczyk](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michal_goralczyk/32/55564_2.png) [@Michal\_Goralczyk](https://forum.inductiveautomation.com/u/Michal_Goralczyk)\
**Post date:** [August 28, 2023, 7:29am UTC](https://forum.inductiveautomation.com/t/unexpected-behavior-of-email-notifications/78440/1 "2023-08-28T07:29:32Z")

</div>

Hello,

I have set up email notifications using a script. They trigger using the schadule method on the gateway at specific times. Below is what it looks like:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/5/353b195d6fe5153cef0489e6af7d11555365dcab.png)

```auto
def onScheduledEvent():
	subject = "Sample_string"
	body = 'Sample_string \n\n'
	recipients = ["x@x.com"]
	#cc_recipients = ["x@x.com"]
	smtpProfile = "EmailProfile"
	
	system.net.sendEmail(smtpProfile=smtpProfile, fromAddr="x@x.com", subject=subject, body=body, html=0, to=recipients)	

```

However, duplicate emails are coming into the mail I don't know what could be the reason for sending two emails instead of one. What is the cause or how can this be debugged?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/2/62b8a60df4e8579201bf72b2769874ae1d394f4e.png)

Another question that comes up when sending emails is what encoding to use to send special characters such as: ą, ć, ę, ł, ń, ó, ś, ź, ż I receive in the message ÄÄÅÄÅ¼ÅºÃ³

Best regards,  
Michał

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 28, 2023, 11:36am UTC](https://forum.inductiveautomation.com/t/unexpected-behavior-of-email-notifications/78440/2 "2023-08-28T11:36:27Z")

</div>

> [@Michal\_Goralczyk](#):
>
> could be the reason for sending two emails instead of one

The most common reason for this is defining the event in an inheritable project that has two leaf projects. Events should never be defined in inheritable projects for this reason.

---

<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:** [August 28, 2023, 2:54pm UTC](https://forum.inductiveautomation.com/t/unexpected-behavior-of-email-notifications/78440/3 "2023-08-28T14:54:23Z")

</div>

> [@Michal\_Goralczyk](#):
>
> Another question that comes up when sending emails is what encoding to use to send special characters such as: ą, ć, ę, ł, ń, ó, ś, ź, ż I receive in the message ÄÄÅÄÅ¼ÅºÃ³

Try prefixing any literal strings you are writing in Python code with the letter u. As in:  
`u'Some string'`  
Instead of  
`'Some string'`

---

<div class="post-metadata">

**Author:** ![Michal\_Goralczyk](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michal_goralczyk/32/55564_2.png) [@Michal\_Goralczyk](https://forum.inductiveautomation.com/u/Michal_Goralczyk)\
**Post date:** [September 1, 2023, 1:46pm UTC](https://forum.inductiveautomation.com/t/unexpected-behavior-of-email-notifications/78440/4 "2023-09-01T13:46:13Z")

</div>

@paul-griffith @pturmel Yes these are the answers to my questions! Ignition has a great community. Thank you!
