# Email Read timed out

**URL:** <https://forum.inductiveautomation.com/t/email-read-timed-out/87455>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [March 18, 2024, 4:22am UTC](https://forum.inductiveautomation.com/t/email-read-timed-out/87455 "2024-03-18T04:22:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrd](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@jrd](https://forum.inductiveautomation.com/u/jrd)\
**Post date:** [March 18, 2024, 4:22am UTC](https://forum.inductiveautomation.com/t/email-read-timed-out/87455/1 "2024-03-18T04:22:33Z")

</div>

Using Ignition Version: **8.1.36 (b2024010211)**, Perspective & Windows 11  
I have configured email in Gateway, & successfully sent a test email to myself from gateway

Now I am trying to configure a button to send email onClick  
My button Click code is (with names changed to protect the innocent!):

```auto
def runAction(self, event):
	stmp = "smtp.telstra.com:465:tls"
	fromAddr = "someone@bigpond.net.au"
	subject = "abc"
	body = "qwerty"
	to = "someoneElse@bigpond.net.au"
	
	system.net.sendEmail(stmp,fromAddr, subject, body, False, to )

```

I get a "read timed out message:

```auto
com.inductiveautomation.ignition.common.script.JythonExecException
Traceback (most recent call last):
  File "<function:runAction>", line 17, in runAction
  nested exception is:
	java.net.SocketTimeoutException: Read timed out

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

	caused by org.python.core.PyException
Traceback (most recent call last):
  File "<function:runAction>", line 17, in runAction
  nested exception is:
	java.net.SocketTimeoutException: Read timed out

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

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

	caused by SocketTimeoutException: Read timed out

Ignition v8.1.36 (b2024010211)
Java: Azul Systems, Inc. 17.0.8

```

There are many things in this world I don't understand. Now I don't understand why I get a "READ" error.  
Can someone enlighten me please

---

<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:** [March 18, 2024, 9:30am UTC](https://forum.inductiveautomation.com/t/email-read-timed-out/87455/2 "2024-03-18T09:30:40Z")

</div>

If you're sending mail through an external SMTP server wouldn't you have to supply login details for authentication? I'm confused though; I don't think I've ever used system.net.sendEmail but I thought that you would use an Ignition email profile set on the gateway?

Tip: You've named your variable "stmp" instead of "smtp" (Simple Mail Transfer Protocol) - but you've been consistent so that's not the cause of your error.

---

<div class="post-metadata">

**Author:** ![jrd](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@jrd](https://forum.inductiveautomation.com/u/jrd)\
**Post date:** [March 19, 2024, 3:53am UTC](https://forum.inductiveautomation.com/t/email-read-timed-out/87455/3 "2024-03-19T03:53:46Z")

</div>

Fixed now  
I was not calling the function with parameters named correctly  
Thanks for the help
