span8
span4
span8
span4
This article was updated using FME Server 2018.1, but steps used can be applied to FME Server 2016 and above. For the FME Server 2015 version of this article, please see:Sending email, Part 5: Sending an email with attachments.
Previous section:Sending email, Part 4
This tutorial is part of the seriesEmail in FME Server. This is the fifth article in the sending emails series. This article will cover how to send emails with attachments through the FME Server.
As covered inpart 2, in order to send an email from a workspace, you must generate the JSON for the email notification and then notify the Server. To add support for attachments, the email_attachment keyword needs adding to the JSON with a path to the file you wish to send. The FMEServerEmailGenerator handles this automatically for us.
You can use the workspace from thepart 2of the tutorial, or download the attached fmw file.
TThe path to the data must be accessible to the FME Server Engine that runs the job. You should either be pointing to data locally on the server, or on an accessibly shared drive (e.g. UNC path) if you are using on-premises FME Server. Alternatively, you can use theResources foldersto store the data for the attachments [e.g $(FME_SHAREDRESOURCE_MYDATA)/Parks.zip].
If you don’t receive an email, you can do the following to troubleshoot:
Enable monitoring on the SEND_EMAIL topic in the FME Server web interface. This will show you what content is being received on the topic.
If JSON content is being received in the topic, your SMTP settings are probably incorrect. Review them, and try again.
For more information about troubleshooting notifications with log files, seeAbout Log Files in FME Server.
In this part of the tutorial, we’ve sent an email with an attachment using FME Server and an SMTP server. We did this from a workspace using the FMEServerEmailGenerator transformer but all this is doing is generating JSON and submitting it to the FME Server via the FMEServerNotifier transformer. You can do the same programatically as defined in theFME Server Playground
.
Do the attachments need to use an attribute instead of a value entered through the text editor? We are trying to use the resources folder, but it doesn't send the email with an attachment. If I remove the attachment setting the email will send. Would it be possible to read the attachments into a different attribute, so it doesn't rely on having access to the data?
Thanks in advance for the help,
Tyson
It should certainly be possible to set the value of the attachment in the text editor rather than using an attribute.
How are you referencing the path to resources? You should be able to use either the full UNC path to your FME Server System Share location, or the FME Server Parameters e.g. $(FME_SHAREDRESOURCE_DATA) will point to the Data Resources Folder.
What does the error in the email.log report? (Resources > Logs > Core > Current | Old > Subscribers)
It shows that the email was sent successfully, but it never shows up in our mailbox. Is there an easy way to test connecting to the FME Server data from a desktop workbench?
I have it using the FME Server parameter you mentioned with \filename.type at the end of the setting.
Sending email, Part 5: Sending an email with attachments (2015)
Sending email, Part 3: Sending an email when a workspace completes (2015)
Sending email, Part 2: Sending an email using the FMEServerNotifier (2015)
接收电子邮件,第2部分:处理邮件和workspace (2015)
Receiving email, Part 3: Using email attachments (2015)
Receiving email, Part 1: Setting up a topic and an email address (2015)
Sending email, Part 4: Sending prettier email using HTML (2015)
Sending email, Part 1: Setting up a topic and an email subscriber (2015)
Receiving email, Part 1: Setting up a topic and an email address
Sending email, Part 3: Sending an email when a workspace completes (2014)
© 2020 Safe Software Inc |Legal