Unable to send report via email

Anyone have a suggestion as to why I would be getting the following error log when attempting to run system.report.executeAndDistribute?

[projectName=Project,reportPath=Report] SMTP server name smpt.com in Email does not exist.

Script used:

email_settings = {"to":["myself@email.com"], "smtpServerName":"SMPT", "from":"myself@email.com", 'body':'this is a test', "subject":"Production Report ", "attachmentName":'file'}
system.report.executeAndDistribute(path="Daily Report", project = "Project", action = "email", actionSettings = email_settings)

I’m going to assume that the report path and SMTP server names not matching between your script and the error message are just an artifact of obfuscation so you could post it.

That error happens when the report execution tries to get the details of the SMTP server you named and fails to find it. Did you actually create an SMTP server on the gateway with that exact name?

Thank you Kathy. I was calling the SMPT address directly, vs. a SMPT profile name setup in the Gateway. Once I made that change, I am able to complete the executeAndDistribute function.

Another question - Is there a limit to what datatypes you can send as a parameter? Is it possible to send a date? I was only successful sending a str version of the date.

1 Like

Kathy, questions.
I set 8 reports to get emailed every weekend at 5am but only 3 of them went out this past weekend. All the reports are configured the same. Do you know what could be the issue?

On a side note. I have Ignition 8.1. Does 8.1 require a client to be open in order for reports to get emailed?

It might be better if you created a new post, some info like how you are running the reports (a script or report scheduler), maybe some of your code and/or config, and any errors you might see in the gateway logs. Then you can ping Kathy by typing her user name starting with @.