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