# Getting An Error to send a email

**URL:** <https://forum.inductiveautomation.com/t/getting-an-error-to-send-a-email/68154>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [January 3, 2023, 11:06am UTC](https://forum.inductiveautomation.com/t/getting-an-error-to-send-a-email/68154 "2023-01-03T11:06:03Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sanket\_Landge](https://avatars.discourse-cdn.com/v4/letter/s/8edcca/32.png) [@Sanket\_Landge](https://forum.inductiveautomation.com/u/Sanket_Landge)\
**Post date:** [January 3, 2023, 11:06am UTC](https://forum.inductiveautomation.com/t/getting-an-error-to-send-a-email/68154/1 "2023-01-03T11:06:03Z")

</div>

getting an error to send a email from ignition like: com.inductiveautomation.ignition.client.gateway\_interface.GatewayException: com.inductiveautomation.ignition.client.gateway\_interface.GatewayException: Error sending email. Session id=F65CF6D0

recipients = ["[sanketlandge.1999@gmail.com](mailto:sanketlandge.1999@gmail.com)"]  
From = "[sanketlandge.28@gmail.com](mailto:sanketlandge.28@gmail.com)"  
Subject="Test email from Ignition"  
body="This is a test email"  
system.net.sendEmail(smtpProfile="A1",fromAddr=From,subject=Subject,body=body,html=1,to=recipients)

 ![Screenshot](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/b/8ba910204d4ca6eaebfbe7c66cbdbe5e75dff601.png)

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [January 3, 2023, 11:28am UTC](https://forum.inductiveautomation.com/t/getting-an-error-to-send-a-email/68154/2 "2023-01-03T11:28:38Z")

</div>

> [@Alarm notification by mail does not work](https://forum.inductiveautomation.com/t/alarm-notification-by-mail-does-not-work/31513/10):
>
> I realize this is old but I just went through this today and couldn’t figure out why my SMTP setup was not working correctly. So this is for anyone else that may come across the same issue, you can use Gmail smtp, you just have to generate an App Password as Gmail no longer supports what they consider “less secure apps”. To generate an app password you have to login to your Google Account then find the “Manage Your Google Account” button. From there navigate to Security and find the heading “S…

---

<div class="post-metadata">

**Author:** ![Sanket\_Landge](https://avatars.discourse-cdn.com/v4/letter/s/8edcca/32.png) [@Sanket\_Landge](https://forum.inductiveautomation.com/u/Sanket_Landge)\
**Post date:** [January 3, 2023, 11:32am UTC](https://forum.inductiveautomation.com/t/getting-an-error-to-send-a-email/68154/3 "2023-01-03T11:32:51Z")

</div>

I have already added app password for my gmail account and that password i'm using here but not working

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [January 3, 2023, 11:37am UTC](https://forum.inductiveautomation.com/t/getting-an-error-to-send-a-email/68154/4 "2023-01-03T11:37:04Z")

</div>

- Did you look at the settings used in the post I linked to?
- smtpProfile="And On" does not match "A1" used in your screenshot.

---

<div class="post-metadata">

**Author:** ![Sanket\_Landge](https://avatars.discourse-cdn.com/v4/letter/s/8edcca/32.png) [@Sanket\_Landge](https://forum.inductiveautomation.com/u/Sanket_Landge)\
**Post date:** [January 3, 2023, 11:38am UTC](https://forum.inductiveautomation.com/t/getting-an-error-to-send-a-email/68154/5 "2023-01-03T11:38:06Z")

</div>

i have changed that

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [January 3, 2023, 11:41am UTC](https://forum.inductiveautomation.com/t/getting-an-error-to-send-a-email/68154/6 "2023-01-03T11:41:29Z")

</div>

> [@JordanCClark](#):
>
> - Did you look at the settings used in the post I linked to?

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

---

<div class="post-metadata">

**Author:** ![Sanket\_Landge](https://avatars.discourse-cdn.com/v4/letter/s/8edcca/32.png) [@Sanket\_Landge](https://forum.inductiveautomation.com/u/Sanket_Landge)\
**Post date:** [January 3, 2023, 11:51am UTC](https://forum.inductiveautomation.com/t/getting-an-error-to-send-a-email/68154/7 "2023-01-03T11:51:55Z")

</div>

![smtp error](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/8/28a7f1972927f846f538c049bff0bc008c2558e3.png)  
 ![smtp profile](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/f/0f4adc387af219d222bfc309e67907b25f29b388.png)

I have added app password for mail account, and that i'm using in smtp profile

---

<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:** [January 3, 2023, 1:25pm UTC](https://forum.inductiveautomation.com/t/getting-an-error-to-send-a-email/68154/8 "2023-01-03T13:25:14Z")

</div>

An unknown host exception means Ignition isn't even getting to open a connection to gmail, as it cannot find it. Fix your DNS system for the gateway.

---

<div class="post-metadata">

**Author:** ![Sanket\_Landge](https://avatars.discourse-cdn.com/v4/letter/s/8edcca/32.png) [@Sanket\_Landge](https://forum.inductiveautomation.com/u/Sanket_Landge)\
**Post date:** [January 3, 2023, 4:29pm UTC](https://forum.inductiveautomation.com/t/getting-an-error-to-send-a-email/68154/9 "2023-01-03T16:29:04Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/8/7886d0ee857e2227877d6d3c34bb7928449f66a0.png)

Now I'm trying using my company office 365 mail but getting error

javax.mail.AuthenticationFailedException: ;  
nested exception is:  
javax.mail.MessagingException: Exception reading response;  
nested exception is:  
java.net.SocketTimeoutException: Read timed out
