# sendEmail Timeout

**URL:** <https://forum.inductiveautomation.com/t/sendemail-timeout/4153>\
**Category:** Ignition\
**Created:** [March 15, 2012, 5:41pm UTC](https://forum.inductiveautomation.com/t/sendemail-timeout/4153 "2012-03-15T17:41:22Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ecujak](https://avatars.discourse-cdn.com/v4/letter/e/839c29/32.png) [@ecujak](https://forum.inductiveautomation.com/u/ecujak)\
**Post date:** [March 15, 2012, 5:41pm UTC](https://forum.inductiveautomation.com/t/sendemail-timeout/4153/1 "2012-03-15T17:41:22Z")

</div>

I am able to create and send emails using these same settings configured on the gateway. Why am I timing out when using the sendEmail function in event handler script.

`SMSBody = event.source.parent.getComponent('TextArea_Message').text
SMSSubject = "MySubject"
SendToList=['1234567890@vtext.com']
system.net.sendEmail(smtp="smtp.gmail.com:465:ssl", from="myaccount@gmail.com", subject=SMSSubject, body=SMSBody, html=0, to=SendToList, username='myaccount', password='mypassword')`

---

<div class="post-metadata">

**Author:** ![ecujak](https://avatars.discourse-cdn.com/v4/letter/e/839c29/32.png) [@ecujak](https://forum.inductiveautomation.com/u/ecujak)\
**Post date:** [March 15, 2012, 5:42pm UTC](https://forum.inductiveautomation.com/t/sendemail-timeout/4153/2 "2012-03-15T17:42:29Z")

</div>

I have tried what I found in the link below and the one within it as well, but no luck.

[viewtopic.php?f=70&t=7565&p=23166&hilit=sendEmail+port#p23166](http://www.inductiveautomation.com/forum/viewtopic.php?f=70&t=7565&p=23166&hilit=sendEmail+port#p23166)

---

<div class="post-metadata">

**Author:** ![Dravik](https://avatars.discourse-cdn.com/v4/letter/d/e274bd/32.png) [@Dravik](https://forum.inductiveautomation.com/u/Dravik)\
**Post date:** [March 15, 2012, 6:17pm UTC](https://forum.inductiveautomation.com/t/sendemail-timeout/4153/3 "2012-03-15T18:17:30Z")

</div>

Can your client machine talk to the smtp server?  
Is this event script executing from the client side?

---

<div class="post-metadata">

**Author:** ![ecujak](https://avatars.discourse-cdn.com/v4/letter/e/839c29/32.png) [@ecujak](https://forum.inductiveautomation.com/u/ecujak)\
**Post date:** [March 15, 2012, 6:36pm UTC](https://forum.inductiveautomation.com/t/sendemail-timeout/4153/4 "2012-03-15T18:36:55Z")

</div>

Actually… the client machine I am testing on can connect, but the clients on the production floor will not have those rights. My goal is to have the server/gateway actually send and receive the email.

---

<div class="post-metadata">

**Author:** ![Dravik](https://avatars.discourse-cdn.com/v4/letter/d/e274bd/32.png) [@Dravik](https://forum.inductiveautomation.com/u/Dravik)\
**Post date:** [March 15, 2012, 6:40pm UTC](https://forum.inductiveautomation.com/t/sendemail-timeout/4153/5 "2012-03-15T18:40:19Z")

</div>

Nm, i just checked and it says it gets relayed through the Gateway anyhow… I should read before I post sometimes…

---

<div class="post-metadata">

**Author:** ![ecujak](https://avatars.discourse-cdn.com/v4/letter/e/839c29/32.png) [@ecujak](https://forum.inductiveautomation.com/u/ecujak)\
**Post date:** [March 15, 2012, 6:57pm UTC](https://forum.inductiveautomation.com/t/sendemail-timeout/4153/6 "2012-03-15T18:57:49Z")

</div>

[size=60]I didn’t even think of that possibility until you mentioned it. My background is web over browser based so this Applet/j2ee/client stuff is a way over my head. I love all the things this software does, but I am having trouble understanding how to do some of the minor things like what I am asking here. [/size]

Is my problem with the smtp server field?  
Are my parameters wrong? I noticed in the documentation that when using credentials and not attaching a file they had the variable=“value” format otherwise just passing the value.

Before changing smtp from “[smtp.gmail.com](http://smtp.gmail.com)” to “[smtp.gmail.com:465](http://smtp.gmail.com:465):ssl” I got a [color=#FF0000]cannot communicate with server on port 25 error[/color]. Now I just time out.

Has anyone been able to send mail with script using gmail smtp server. My tag alerts use this same server and account with no issues.

---

<div class="post-metadata">

**Author:** ![Dravik](https://avatars.discourse-cdn.com/v4/letter/d/e274bd/32.png) [@Dravik](https://forum.inductiveautomation.com/u/Dravik)\
**Post date:** [March 15, 2012, 7:04pm UTC](https://forum.inductiveautomation.com/t/sendemail-timeout/4153/7 "2012-03-15T19:04:30Z")

</div>

Hmm, maybe try 587:tls , just to test that instead of ssl.

---

<div class="post-metadata">

**Author:** ![Greg.Buehler](https://avatars.discourse-cdn.com/v4/letter/g/ecc23a/32.png) [@Greg.Buehler](https://forum.inductiveautomation.com/u/Greg.Buehler)\
**Post date:** [March 15, 2012, 7:15pm UTC](https://forum.inductiveautomation.com/t/sendemail-timeout/4153/8 "2012-03-15T19:15:57Z")

</div>

Just thought [http://support.google.com/mail/bin/answer.py?hl=en&answer=13287](http://support.google.com/mail/bin/answer.py?hl=en&answer=13287) might be relevant.

---

<div class="post-metadata">

**Author:** ![ecujak](https://avatars.discourse-cdn.com/v4/letter/e/839c29/32.png) [@ecujak](https://forum.inductiveautomation.com/u/ecujak)\
**Post date:** [March 15, 2012, 8:16pm UTC](https://forum.inductiveautomation.com/t/sendemail-timeout/4153/9 "2012-03-15T20:16:59Z")

</div>

> [@Dravik](#):
>
> Hmm, maybe try 587:tls , just to test that instead of ssl.

holy shit... ![:scratch:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/76d1620bec252bfac07050c889ff5a91dc8a9c25.gif ":scratch:") it worked with 587:tls

... but why not with what I am using in the gateway alert settings?

---

<div class="post-metadata">

**Author:** ![Dravik](https://avatars.discourse-cdn.com/v4/letter/d/e274bd/32.png) [@Dravik](https://forum.inductiveautomation.com/u/Dravik)\
**Post date:** [March 15, 2012, 9:03pm UTC](https://forum.inductiveautomation.com/t/sendemail-timeout/4153/10 "2012-03-15T21:03:15Z")

</div>

The only thing I can guess here, Maybe sendEmail isn’t sourcing the ssl class of the python function?
