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 = “
sender = ""
subject = “stilstanden rapport”
body = “hier is het rapport van de stilstanden”
recipients = [“”], 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:, 25; timeout 10000;

nested exception is:

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

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

1 Like

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