Send report by Email

Can i send generated report automatically by Email?? . i Have reporting Module Ver: 1.5
I have active-x component .How can i import this active-x in designer?

You can send a report automatically via email only if a client is open. Typically, people open a client on the server machine and make a screen that will generate the report and email it at various times throughout the day. You can use Ignition’s email function: … demail.htm

You can get the bytes of a PDF by doing the following:report = event.source.parent.getComponent("Report") pdfBytes = report.getBytesPDF()

Ok, I am trying to send an email with a PDF of a report viewer component as an attachment. I am getting the PDF bytes just fine, but I get a MIME type error when I try to send the message:

“caused by GatewayException: Error sending email.
caused by javax.mail.internet.ParseException: Expected MIME type, got null”

Googling around, it might be that the Content-Type isn’t set correctly. Is there any way to set this, or should I be doing this another way?

[code]from java.util import Date
from java.util import Calendar
cal = Calendar.getInstance()
todayDateStr = system.db.dateFormat(cal.getTime(), “MM/dd/yyyy”)

report=event.source.parent.getComponent(‘Report Viewer’) #Get Report

attachmentData=[report.getBytesPDF()] #Make into PDF data for email
smtp1 = “XXXXX”
sender = “XXXXX”
recipients = [“XXXXXX”]
subject = “Ignition Email Report for (” + todayDateStr + “)”
body = “”"
Report Data goes here
Another line of text
“”", sender, subject, body, 0, recipients, attachmentNames, attachmentData)

Stack Trace:
Caused by: javax.mail.internet.ParseException: Expected MIME type, got null
at javax.mail.internet.ContentType.(
at javax.mail.internet.MimeBodyPart.updateHeaders(
at javax.mail.internet.MimeBodyPart.updateHeaders(
at javax.mail.internet.MimeMultipart.updateHeaders(
at javax.mail.internet.MimeBodyPart.updateHeaders(
at javax.mail.internet.MimeMessage.updateHeaders(
at javax.mail.internet.MimeMessage.saveChanges(
at javax.mail.Transport.send(
at com.inductiveautomation.ignition.gateway.script.GatewayNetUtilities.sendEmail(
at com.inductiveautomation.ignition.gateway.servlets.Gateway._sendEmail(
at com.inductiveautomation.ignition.gateway.servlets.Gateway.doPost(
at javax.servlet.http.HttpServlet.service(
at javax.servlet.http.HttpServlet.service(
at com.inductiveautomation.ignition.gateway.bootstrap.MapServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.http11.Http11Processor.process(
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(

What version of Ignition are you using? I believe there was an issue with the 7.6 or 7.6.1 version that caused a similar error message. Upgrading solved the issue.

There was an issue and it was fixed for Ignition 7.6.1 in regards to email attachments. If upgrading does not work please let us know what version of Ignition you are using.

I am still seeing this error.

I am using stunnel for a secure connection to get to Gmail to send the email.
I am trying to attach a PDF of the Report Viewer to the email.

If I use None / None for the attachment Name / attachment Data, it works great and goes right through.

If I put in the name / data, I get the following error:

Traceback (most recent call last):

File “event:actionPerformed”, line 8, 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 javax.mail.internet.ParseException: Expected MIME type, got null

Ignition v7.6.2 (b2368)
Java: Sun Microsystems Inc. 1.6.0_45

Try adding .pdf to report name


Just went through this problem.

1 Like

Exactly right! Thanks so much. :smiley:


Glad to hear it is working!