Using SMTP e-mail

I am trying to figure out how to send e-mail messages. My plan is to create a button on a window. Once this button is clicked… a message will be sent via STMP. I am trying to use a scrip command in the event window. But each time I try it… I get a syntax error. I have tried many different things and still can not get it to work. Could someone post a WORKING example?

I have been using this scrip, and putting my data in the fields.

system.net.sendEmail(smtp, from, subject, body, html, to, attachmentNames, attachmentData, timeout, username, password)

Please help.

Tyler

There are a couple of gotchas here. First off, some working code:smtp="your smtp server" myFrom="your email address" subject="Test email from Ignition" body="This is a test email" html=0 to=["destination email"] attachmentNames=[] attachmentData=[] timeout=60000 username="email account username" password="email account password" system.net.sendEmail(smtp,myFrom,subject,body,html,to,attachmentNames,attachmentData,timeout,username,password)You will notice that I haven’t used ‘from’ as a variable name - this can cause problems, so call it something else. Also, ‘to’, ‘attachmentNames’ and ‘attachmentData’ are all Python lists, so must go inside square brackets.

Hopefully this will give you enough to get started.

Ok… so far so good

Now I need to figure out how to set the gateway up so that it will communicate to my internet connection. I used the code but I got this error com.inductiveautomation.ignition.client.gateway_interface.GatewayException: Gateway Error 500: Error sending emaillow.

I assume that there is another setting I am missing in the GATEWAY config.

There shouldn’t be any settings needed to have your Gateway use the computer’s internet connection. Is there something odd about the internet connection? Does it go through a proxy? Can you post the whole stack trace of that error message?

Here you go Carl, I can also send the event handler code if needed.

There is no proxy here. I am running the project here on this laptop and on the internet at the same time. Maybe its a firewall issue… I’ll be checking that too.

Traceback (innermost last):
File “event:mouseClicked”, line 12, in ?
com.inductiveautomation.ignition.client.gateway_interface.GatewayException: Gateway Error 500: Error sending email.

at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.newGatewayException(GatewayInterface.java:236)

at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.sendMessage(GatewayInterface.java:211)

at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.sendEmail(GatewayInterface.java:455)

at com.inductiveautomation.factorypmi.application.script.builtin.ClientNetUtilities._sendEmail(ClientNetUtilities.java:94)

at com.inductiveautomation.ignition.common.script.builtin.AbstractNetUtilities.sendEmail(AbstractNetUtilities.java:89)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)

at com.inductiveautomation.ignition.common.script.ScriptManager$ReflectedInstanceFunction.__call__(ScriptManager.java:286)

at org.python.core.PyObject.__call__(PyObject.java)

at org.python.core.PyObject.invoke(PyObject.java)

at org.python.pycode._pyx7.f$0(<event:mouseClicked>:12)

at org.python.pycode._pyx7.call_function(<event:mouseClicked>)

at org.python.core.PyTableCode.call(PyTableCode.java)

at org.python.core.PyCode.call(PyCode.java)

at org.python.core.Py.runCode(Py.java)

at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:367)

at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.runActions(ActionAdapter.java:138)

at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.invoke(ActionAdapter.java:280)

at com.inductiveautomation.factorypmi.application.binding.action.RelayInvocationHandler.invoke(RelayInvocationHandler.java:55)

at $Proxy0.mouseClicked(Unknown Source)

at java.awt.AWTEventMulticaster.mouseClicked(Unknown Source)

at java.awt.Component.processMouseEvent(Unknown Source)

at javax.swing.JComponent.processMouseEvent(Unknown Source)

at java.awt.Component.processEvent(Unknown Source)

at java.awt.Container.processEvent(Unknown Source)

at java.awt.Component.dispatchEventImpl(Unknown Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)

at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)

at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Window.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.EventQueue.dispatchEvent(Unknown Source)

at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.run(Unknown Source)

Caused by: javax.mail.MessagingException: Could not connect to SMTP host: mail.aol.com, port: 25;
nested exception is:
java.net.ConnectException: Connection timed out: connect

at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1391)

at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:412)

at javax.mail.Service.connect(Service.java:310)

at javax.mail.Service.connect(Service.java:169)

at javax.mail.Service.connect(Service.java:118)

at javax.mail.Transport.send0(Transport.java:188)

at javax.mail.Transport.send(Transport.java:118)

at com.inductiveautomation.ignition.gateway.script.GatewayNetUtilities.sendEmail(GatewayNetUtilities.java:148)

at com.inductiveautomation.ignition.gateway.servlets.Gateway._sendEmail(Gateway.java:1595)

at com.inductiveautomation.ignition.gateway.servlets.Gateway.doPost(Gateway.java:445)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

at com.inductiveautomation.ignition.gateway.bootstrap.MapServlet.service(MapServlet.java:85)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)

at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

at java.lang.Thread.run(null)

com.inductiveautomation.ignition.client.gateway_interface.GatewayException: com.inductiveautomation.ignition.client.gateway_interface.GatewayException: Gateway Error 500: Error sending email.

at org.python.core.Py.JavaError(Py.java)
at com.inductiveautomation.factorypmi.application.script.builtin.ClientNetUtilities._sendEmail(ClientNetUtilities.java:97)
at com.inductiveautomation.ignition.common.script.builtin.AbstractNetUtilities.sendEmail(AbstractNetUtilities.java:89)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
at com.inductiveautomation.ignition.common.script.ScriptManager$ReflectedInstanceFunction.__call__(ScriptManager.java:286)
at org.python.core.PyObject.__call__(PyObject.java)
at org.python.core.PyObject.invoke(PyObject.java)
at org.python.pycode._pyx7.f$0(<event:mouseClicked>:12)
at org.python.pycode._pyx7.call_function(<event:mouseClicked>)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyCode.call(PyCode.java)
at org.python.core.Py.runCode(Py.java)
at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:367)
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.runActions(ActionAdapter.java:138)
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.invoke(ActionAdapter.java:280)
at com.inductiveautomation.factorypmi.application.binding.action.RelayInvocationHandler.invoke(RelayInvocationHandler.java:55)
at $Proxy0.mouseClicked(Unknown Source)
at java.awt.AWTEventMulticaster.mouseClicked(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

[quote]Caused by: javax.mail.MessagingException: Could not connect to SMTP host: mail.aol.com, port: 25;
nested exception is:[/quote]
This is the important part of the error message. It looks like you are using port 25; that could be your problem. Are your username/password correct? I found this in a quick google search (office.microsoft.com). It talks specifically about outlook, but the facts are the same.

[quote]The outgoing e-mail server is a Simple Mail Transfer Protocol (SMTP) server, the same type used by many ISPs. However, AOL requires authentication on their SMTP e-mail server. This requirement means that you must provide a user name and password — the same as your AOL screen name and password — before you send your e-mail message. You can save the user name and password in Outlook so that you enter the information just one time.

SMTP servers usually use port number 25. However, AOL uses port number 587. You need to specify this port number when you configure Outlook for your AOL e-mail account.[/quote]

Well… I found another problem with it also… but it still didnt help. AOL uses “smtp.aol.com” so I changed that in the code and it still gave the same error.

For this e-mail to work… do I need outlook configured??? I was trying to send this just through the code of the event handler.

I usually do not use outlook for my emails. I usually just log onto AOL. Anyway. My whole purpose for this exersize was to see if I could send an email using the event handler. So I just thought that if the code was entered into the script, then it would handle the rest.

I have configured outlook express. I can send mail using outlook through aol and everything works fine using outlook. I leave outlook running and then try to run my script… and I still get the same error 500.

I need to get this figured out. I am trying to design a SCADA system for a client, and that is one feature they have requested. My plan is to have e-mail sent when a condition is met, but for now I am trying to test it with the click of a mouse.

Does anyone have any other ideas?

This has nothing to do with Outook - you certainly don’t need Outlook installed.

It sends the email through the Ignition Gateway - is that also on your laptop? Did you read Robert’s suggestion about how AOL uses port 587?

You should put the port into the smtp field. IE:

smtp="smtp.aol.com:587:tls" myFrom="me@mycompany.com" subject="Test email from Ignition" body="This is a test email" html=0 to=["them@mycompany.com"] attachmentName="file1.txt" attachmentData=system.file.readFileAsBytes("c:\\myfolder\\file1.txt") timeout=60000 username="me@aol.com" password="p4ssw0rd" system.net.sendEmail(smtp,myFrom,subject,body,html,to,[attachmentName],[attachmentData],timeout,username,password)
If you can’t get this work, does it work without adding the attachments?

Thanks Robert and Carl for your support, but I am I still getting the same error,

Yes I had already tried adding the PORT to the smtp… I just didnt have the “:tls” after the port.
what does the “:tls” do for this line?

I have turned my firewall off… so there should not be a port blocking issue.

To Carls Question. Yes… The Ignition Gateway is also running on this laptop.

To Roberts Question. I was trying all along to just send the “body” of the email… no attachments.
I have now even tried attachments.

In my code… this is the last line of code… also note that it is line 12 in the eventbuilder.
system.net.sendEmail(smtp,myfrom,subject,body,html,to,[attachmentName],[attachmentData],timeout,username,password)

the error always comes back stating the same thing…
Traceback (innermost last):
File “event:mouseClicked”, line 12, in ?
com.inductiveautomation.ignition.client.gateway_interface.GatewayException: Gateway Error 500: Error sending email.

Because this error refers to line 12… I guess the problem could be anywhere??

I know when I had errors before due to some syntax errors… it would should the line number that had the error.

I have even tried using a GMAIL account to send mail through instead of AOL… and get the same error.

Here is the code I am using… I have only changed the password and usernames to protect the innocent.

smtp=“smtp.aol.com:587:tls”
myfrom="myemail@aol.com"
subject=“Test”
body=“This is to test my program”
html=0
to=[“tuttleelectric@aol.com”]
attachmentName=“file1.txt”
attachmentData=system.file.readFileAsBytes(“c:\myfolder\file1.txt”)
timeout=60000
username=“myusername”
password=“mypassword”
system.net.sendEmail(smtp,myfrom,subject,body,html,to,[attachmentName],[attachmentData],timeout,username,password)

Any more ideas? Do you see any errors here?

Are you still getting the same underlying error with that code? I.e. the part that used to say:

Caused by: javax.mail.MessagingException: Could not connect to SMTP host: mail.aol.com, port: 25; nested exception is: java.net.ConnectException: Connection timed out: connect

also - under the Windows Control Panel, click on the Java control panel, go to “Network Settings…” button and report what it is set to.

For what it's worth, I set this up and am getting the same error. I am using our corp. mail server which is here on site. When I click the button, Ignition connects to the mail server, the problem is, there is no data associated with it.

[quote]T 20100317 092647 4b9fb25a Connection from 65.204.116.138
T 20100317 092647 4b9fb25a EHLO superior-scada
T 20100317 092648 4b9fb25a AUTH LOGIN
T 20100317 092648 4b9fb25a MAIL FROM:mshaffer@superiorfibers.com
T 20100317 092648 4b9fb25a RCPT TO:post@superiorfibers.com
[color=#FF4000]T 20100317 092648 4b9fb25a DATA[/color]
T 20100317 092648 4b9fb25a Connection closed with 65.204.116.138, 1 sec. elapsed.
T 20100317 092650 4b9fb259 QUIT
[/quote]

Normally DATA will have lines and bytes associated with it:

Using this expression:

smtp="mail.superiorfibers.com:25" myFrom="mshaffer@superiorfibers.com" subject="Test email from Ignition" body="This is a test email" html=0 to=["post@superiorfibers.com"] attachmentName="file1.txt" attachmentData=system.file.readFileAsBytes("C:\myfolder\\file1.txt") timeout=60000 username="mshaffer" password="xxxxxxx" system.net.sendEmail(smtp,myFrom,subject,body,html,to,[attachmentName],[attachmentData],timeout,username,password)

I know this is not a solution, but I thought it might be helpful in showing that Ignition is indeed talking to the mail server, it's just not passing the data. Might narrow down where to look.

Is this a typo?attachmentData=system.file.readFileAsBytes("C:\myfolder\\file1.txt")There should be pairs of backslashes in the address because of the way python escapes them. The string should look like "C:\\myfolder\\file1.txt"
Also, you can drop a print command in your code to make sure you are actually getting data to put into the sendEmail function. It would look like this:smtp="mail.superiorfibers.com:25" myFrom="mshaffer@superiorfibers.com" subject="Test email from Ignition" body="This is a test email" html=0 to=["post@superiorfibers.com"] attachmentName="file1.txt" attachmentData=system.file.readFileAsBytes("C:\myfolder\\file1.txt") print attachmentData #<-!!!! timeout=60000 username="mshaffer" password="xxxxxxx" system.net.sendEmail(smtp,myFrom,subject,body,html,to,[attachmentName],[attachmentData],timeout,username,password) And it will print out to the console. You can access that by pressing ctrl-shift-C in the Designer, or by going to Help->Diagnostics and clicking the Console tab.

To answer some of your questions… Java Network is set to Use Internet Browser Settings.

Yes… that was a TYPO in the “C:\myfolder\file1.txt” . I had 2 back slashes.

I think It is now trying to communicate with the AOL server… I am getting a MIME error now, which makes me think the problem now lies within the attachmentData.

How can you send a text without an attachment file? I have tried many different ways and get a few different errors.

I have tried 4 different mail SMTP mail servers… I get different errors with each. I am most certain that its logging onto AOL now. I just need to figure out the MIME problem. Hopefully that will fix it.

Got anymore ideas?

Here is what the error looks like now.

Traceback (innermost last):
File “event:mouseClicked”, line 12, in ?
com.inductiveautomation.ignition.client.gateway_interface.GatewayException: Gateway Error 500: Error sending email.

at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.newGatewayException(GatewayInterface.java:236)

at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.sendMessage(GatewayInterface.java:211)

at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.sendEmail(GatewayInterface.java:455)

at com.inductiveautomation.factorypmi.application.script.builtin.ClientNetUtilities._sendEmail(ClientNetUtilities.java:94)

at com.inductiveautomation.ignition.common.script.builtin.AbstractNetUtilities.sendEmail(AbstractNetUtilities.java:89)

at sun.reflect.GeneratedMethodAccessor51.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)

at com.inductiveautomation.ignition.common.script.ScriptManager$ReflectedInstanceFunction.__call__(ScriptManager.java:286)

at org.python.core.PyObject.__call__(PyObject.java)

at org.python.core.PyObject.invoke(PyObject.java)

at org.python.pycode._pyx126.f$0(<event:mouseClicked>:12)

at org.python.pycode._pyx126.call_function(<event:mouseClicked>)

at org.python.core.PyTableCode.call(PyTableCode.java)

at org.python.core.PyCode.call(PyCode.java)

at org.python.core.Py.runCode(Py.java)

at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:367)

at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.runActions(ActionAdapter.java:138)

at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.invoke(ActionAdapter.java:280)

at com.inductiveautomation.factorypmi.application.binding.action.RelayInvocationHandler.invoke(RelayInvocationHandler.java:55)

at $Proxy0.mouseClicked(Unknown Source)

at java.awt.AWTEventMulticaster.mouseClicked(Unknown Source)

at java.awt.Component.processMouseEvent(Unknown Source)

at javax.swing.JComponent.processMouseEvent(Unknown Source)

at java.awt.Component.processEvent(Unknown Source)

at java.awt.Container.processEvent(Unknown Source)

at java.awt.Component.dispatchEventImpl(Unknown Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)

at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)

at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Window.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.EventQueue.dispatchEvent(Unknown Source)

at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.run(Unknown Source)

Caused by: javax.mail.MessagingException: IOException while sending message;
nested exception is:
javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed;
boundary="----=_Part_155_4220820.1268856640484"

at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:676)

at javax.mail.Transport.send0(Transport.java:189)

at javax.mail.Transport.send(Transport.java:118)

at com.inductiveautomation.ignition.gateway.script.GatewayNetUtilities.sendEmail(GatewayNetUtilities.java:148)

at com.inductiveautomation.ignition.gateway.servlets.Gateway._sendEmail(Gateway.java:1595)

at com.inductiveautomation.ignition.gateway.servlets.Gateway.doPost(Gateway.java:445)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

at com.inductiveautomation.ignition.gateway.bootstrap.MapServlet.service(MapServlet.java:85)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)

at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

at java.lang.Thread.run(null)

com.inductiveautomation.ignition.client.gateway_interface.GatewayException: com.inductiveautomation.ignition.client.gateway_interface.GatewayException: Gateway Error 500: Error sending email.

at org.python.core.Py.JavaError(Py.java)
at com.inductiveautomation.factorypmi.application.script.builtin.ClientNetUtilities._sendEmail(ClientNetUtilities.java:97)
at com.inductiveautomation.ignition.common.script.builtin.AbstractNetUtilities.sendEmail(AbstractNetUtilities.java:89)
at sun.reflect.GeneratedMethodAccessor51.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
at com.inductiveautomation.ignition.common.script.ScriptManager$ReflectedInstanceFunction.__call__(ScriptManager.java:286)
at org.python.core.PyObject.__call__(PyObject.java)
at org.python.core.PyObject.invoke(PyObject.java)
at org.python.pycode._pyx126.f$0(<event:mouseClicked>:12)
at org.python.pycode._pyx126.call_function(<event:mouseClicked>)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyCode.call(PyCode.java)
at org.python.core.Py.runCode(Py.java)
at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:367)
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.runActions(ActionAdapter.java:138)
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.invoke(ActionAdapter.java:280)
at com.inductiveautomation.factorypmi.application.binding.action.RelayInvocationHandler.invoke(RelayInvocationHandler.java:55)
at $Proxy0.mouseClicked(Unknown Source)
at java.awt.AWTEventMulticaster.mouseClicked(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Looks like you’re running into the exact same error as is being worked on in this thread. What version of Java are you running (on your Gateway).

I was running Java 6 vers 4… but I upgraded today to Java 6 ver 18

Ok, I’ve been able to replicate this. For what its worth, it only happens when sending an attachment - emails without attachments work fine. Still not sure what is causing it - I’ll post back when I learn something.

1 Like