# Error configure email

**URL:** <https://forum.inductiveautomation.com/t/error-configure-email/18153>\
**Category:** Ignition\
**Created:** [May 24, 2018, 7:48am UTC](https://forum.inductiveautomation.com/t/error-configure-email/18153 "2018-05-24T07:48:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dgoetschalckx](https://avatars.discourse-cdn.com/v4/letter/d/67e7ee/32.png) [@dgoetschalckx](https://forum.inductiveautomation.com/u/dgoetschalckx)\
**Post date:** [May 24, 2018, 7:48am UTC](https://forum.inductiveautomation.com/t/error-configure-email/18153/1 "2018-05-24T07:48:23Z")

</div>

i have wrote a script to send a email, i’ve got it from the inductiveuniversity.  
#send as email

#get the data  
fileName = “Report.pdf”  
fileData = event.source.parent.getComponent(‘Report Viewer’).getBytesPDF()

#send email  
smtp = “[mail.valeron.com](http://mail.valeron.com)”  
sender = "reports@ignition.com"  
subject = “stilstanden rapport”  
body = “hier is het rapport van de stilstanden”  
recipients = [“jens1011@hotmail.com”]

system.net.sendEmail(smtp, sender, subject, body, 0, recipients, [fileName], [fileData])

but i still have an error and don’t know whats wrong

thanks in advance.

---

<div class="post-metadata">

**Author:** ![jonathan.taylor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jonathan.taylor/32/4048_2.png) [@jonathan.taylor](https://forum.inductiveautomation.com/u/jonathan.taylor)\
**Post date:** [May 24, 2018, 1:06pm UTC](https://forum.inductiveautomation.com/t/error-configure-email/18153/2 "2018-05-24T13:06:20Z")

</div>

Do you get an error message?

---

<div class="post-metadata">

**Author:** ![dgoetschalckx](https://avatars.discourse-cdn.com/v4/letter/d/67e7ee/32.png) [@dgoetschalckx](https://forum.inductiveautomation.com/u/dgoetschalckx)\
**Post date:** [May 24, 2018, 1:08pm UTC](https://forum.inductiveautomation.com/t/error-configure-email/18153/3 "2018-05-24T13:08:39Z")

</div>

Traceback (most recent call last):

File “event:actionPerformed”, line 14, in

com.inductiveautomation.ignition.client.gateway\_interface.GatewayException: com.inductiveautomation.ignition.client.gateway\_interface.GatewayException: Error sending email.

```
caused by GatewayException: Error sending email.
caused by com.sun.mail.util.MailConnectException: Couldn't connect to host, port: mail.valeron.com, 25; timeout 10000;

```

nested exception is:  
java.net.UnknownHostException: [mail.valeron.com](http://mail.valeron.com)

Ignition v7.9.5 (b2017111615)  
Java: Oracle Corporation 1.8.0\_161

---

<div class="post-metadata">

**Author:** ![jonathan.taylor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jonathan.taylor/32/4048_2.png) [@jonathan.taylor](https://forum.inductiveautomation.com/u/jonathan.taylor)\
**Post date:** [May 24, 2018, 1:10pm UTC](https://forum.inductiveautomation.com/t/error-configure-email/18153/4 "2018-05-24T13:10:35Z")

</div>

It’s unable to connect to [mail.valeron.com](http://mail.valeron.com) on port 25 - is this being blocked by your firewall? Are there SSL rules in place that prevent port 25 from being used on the mail server?

---

<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:** [May 24, 2018, 4:39pm UTC](https://forum.inductiveautomation.com/t/error-configure-email/18153/5 "2018-05-24T16:39:40Z")

</div>

The nested exception is UnknownHostException for [mail.valeron.com](http://mail.valeron.com). That suggests DNS is broken at the gateway.
