Error configure email

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
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.

Do you get an error message?

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

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

It’s unable to connect to 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?

The nested exception is UnknownHostException for mail.valeron.com. That suggests DNS is broken at the gateway.