# Sending Email Error- Read timed out

**URL:** <https://forum.inductiveautomation.com/t/sending-email-error-read-timed-out/16774>\
**Category:** Ignition\
**Created:** [January 28, 2018, 5:20pm UTC](https://forum.inductiveautomation.com/t/sending-email-error-read-timed-out/16774 "2018-01-28T17:20:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ctonge](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@ctonge](https://forum.inductiveautomation.com/u/ctonge)\
**Post date:** [January 28, 2018, 5:20pm UTC](https://forum.inductiveautomation.com/t/sending-email-error-read-timed-out/16774/1 "2018-01-28T17:20:01Z")

</div>

I’m sending an email with system.net.sendEmail. The email sends fine, however I get this exception showing a gateway read timeout:

```auto
Java Traceback:

	at org.python.core.Py.JavaError(Py.java:495)
	at com.inductiveautomation.factorypmi.application.script.builtin.ClientNetUtilities._sendEmail(ClientNetUtilities.java:174)
	at com.inductiveautomation.ignition.common.script.builtin.AbstractNetUtilities.sendEmail(AbstractNetUtilities.java:156)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.python.core.PyReflectedFunction. __call__ (PyReflectedFunction.java:186)
	at com.inductiveautomation.ignition.common.script.ScriptManager$ReflectedInstanceFunction. __call__ (ScriptManager.java:429)
	at org.python.core.PyObject. __call__ (PyObject.java:320)
	at org.python.pycode._pyx56.sendCallLogMailAttachments$1(<buffer>:39)
	at org.python.pycode._pyx56.call_function(<buffer>)
	at org.python.core.PyTableCode.call(PyTableCode.java:165)
	at org.python.core.PyBaseCode.call(PyBaseCode.java:301)
	at org.python.core.PyFunction.function ___call__ (PyFunction.java:376)
	at org.python.core.PyFunction. __call__ (PyFunction.java:371)
	at org.python.pycode._pyx56.f$0(<buffer>:45)
	at org.python.pycode._pyx56.call_function(<buffer>)
	at org.python.core.PyTableCode.call(PyTableCode.java:165)
	at org.python.core.PyCode.call(PyCode.java:18)
	at org.python.core.Py.runCode(Py.java:1275)
	at org.python.core.Py.exec(Py.java:1319)
	at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:215)
	at org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter.java:89)
	at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java:70)
	at com.inductiveautomation.ignition.designer.gui.tools.jythonconsole.JythonConsole$InterpreterWorker.doInBackground(JythonConsole.java:476)
	at com.inductiveautomation.ignition.designer.gui.tools.jythonconsole.JythonConsole$InterpreterWorker.doInBackground(JythonConsole.java:464)
	at javax.swing.SwingWorker$1.call(SwingWorker.java:295)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at javax.swing.SwingWorker.run(SwingWorker.java:334)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: com.inductiveautomation.ignition.client.gateway_interface.GatewayException: Read timed out
	at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.newGatewayException(GatewayInterface.java:341)
	at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.getResponse(GatewayInterface.java:501)
	at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.sendMessage(GatewayInterface.java:273)
	at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.sendEmail(GatewayInterface.java:681)
	at com.inductiveautomation.factorypmi.application.script.builtin.ClientNetUtilities._sendEmail(ClientNetUtilities.java:170)
	... 31 more
Caused by: java.net.SocketTimeoutException: Read timed out
	at java.net.SocketInputStream.socketRead0(Native Method)
	at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
	at java.net.SocketInputStream.read(SocketInputStream.java:171)
	at java.net.SocketInputStream.read(SocketInputStream.java:141)
	at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
	at sun.security.ssl.InputRecord.read(InputRecord.java:503)
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983)
	at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:940)
	at sun.security.ssl.AppInputStream.read(AppInputStream.java:105)
	at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
	at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
	at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
	at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:735)
	at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:678)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1587)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
	at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:347)
	at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.getResponse(GatewayInterface.java:421)
	... 34 more
Traceback (most recent call last):
  File "<buffer>", line 45, in <module>
  File "<buffer>", line 39, in sendCallLogMailAttachments
	at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.newGatewayException(GatewayInterface.java:341)
	at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.getResponse(GatewayInterface.java:501)
	at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.sendMessage(GatewayInterface.java:273)
	at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.sendEmail(GatewayInterface.java:681)
	at com.inductiveautomation.factorypmi.application.script.builtin.ClientNetUtilities._sendEmail(ClientNetUtilities.java:170)
	at com.inductiveautomation.ignition.common.script.builtin.AbstractNetUtilities.sendEmail(AbstractNetUtilities.java:156)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)

com.inductiveautomation.ignition.client.gateway_interface.GatewayException: com.inductiveautomation.ignition.client.gateway_interface.GatewayException: Read timed out
>>>

```

Any thoughts/advice?

---

<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 28, 2018, 5:32pm UTC](https://forum.inductiveautomation.com/t/sending-email-error-read-timed-out/16774/2 "2018-01-28T17:32:54Z")

</div>

That suggests that the receiving mail gateway isn’t honoring all of the SMTP protocol formalities after receiving the email, and just dropping the connection. Are you getting the 2xx status code from the mail server indicating successful queuing?  
The mail server’s logs would be needed to know for sure what’s happening.

---

<div class="post-metadata">

**Author:** ![ctonge](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@ctonge](https://forum.inductiveautomation.com/u/ctonge)\
**Post date:** [January 28, 2018, 5:50pm UTC](https://forum.inductiveautomation.com/t/sending-email-error-read-timed-out/16774/3 "2018-01-28T17:50:15Z")

</div>

Thanks for the quick response. The smtp mail server is office365. So not sure how to go about that. Any advice there?

---

<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 28, 2018, 5:52pm UTC](https://forum.inductiveautomation.com/t/sending-email-error-read-timed-out/16774/4 "2018-01-28T17:52:18Z")

</div>

Nope. Won’t touch them with a ten-foot pole.

---

<div class="post-metadata">

**Author:** ![ctonge](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@ctonge](https://forum.inductiveautomation.com/u/ctonge)\
**Post date:** [January 28, 2018, 5:57pm UTC](https://forum.inductiveautomation.com/t/sending-email-error-read-timed-out/16774/5 "2018-01-28T17:57:37Z")

</div>

lol, ok, so I’m happy to setup a different email account. It was struggle to get it working with that account from day one, but something seems to have changed in 7.9.5 as this error only started following my update.

---

<div class="post-metadata">

**Author:** ![Kyle\_Chase](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@Kyle\_Chase](https://forum.inductiveautomation.com/u/Kyle_Chase)\
**Post date:** [January 29, 2018, 3:14am UTC](https://forum.inductiveautomation.com/t/sending-email-error-read-timed-out/16774/6 "2018-01-29T03:14:27Z")

</div>

I would set up a local SMTP server Clint. You will have to play with your dns settings and set up DKIM and SPF records, but it will work solid.

---

<div class="post-metadata">

**Author:** ![ctonge](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@ctonge](https://forum.inductiveautomation.com/u/ctonge)\
**Post date:** [January 29, 2018, 10:02am UTC](https://forum.inductiveautomation.com/t/sending-email-error-read-timed-out/16774/7 "2018-01-29T10:02:41Z")

</div>

Thanks Kyle, I’ll go down that road. Appreciate the help guys.
