This action is used at the end of a workflow run in most instances.
It can be used to announce both a workflow failure or success.
For example, it is not uncommon at the end of a successful load, to send an email to a distribution list announcing that the load was successful and include a log file.
If there are errors, an email can be sent to alert individuals on a distribution list.
The Mail action requires an SMTP server.
You can use authentication and security as part of the connection but you must have the SMTP credentials.
You can attach files to your email messages such as error logs and regular logs.
In addition, logs can be zipped into a single archive for convenience.
How to attach a particular file to the e-mail
You can attach “Result Files” of a particular type(s) to the e-mail, either individually or as a single ZIP archive by checking the option “Attach files to message” and selecting the types to attach under “Select the result files types to attach”. What is a Result File and how to create one? Well, just about any file created during a pipeline may become a Result File, you only need to mark it as such. There are several ways to do that:
When creating a file with a transform that supports it, allow it to mark the file as a Result File. For example the “Text file output” transform has the check-box “Add filenames to result” on the File tab for that purpose. The file type will be General.
Use the transform “Set files in result” from the workflow category to mark a file as a result file of a particular type. This transforms expects the file name to be in a field (you can use e.g. “Generate Rows” in combination with “Add constants” to produce a row containing the file name).
Attaching pipeline’s log
You may easily attach a log file with log of a pipeline run by the workflow prior to sending the mail as follows (suppose we have the workflow Start → Pipeline → Mail):
In the Pipeline workflow action’s options, check “Specify logfile?” and enter a name and extension for the file. You can also specify the desired log level.
In the Mail workflow action’s options, check “Attach files to message” and select (at least) the file type “Log”.