Sending emails with attachments is a common requirement in business intelligence and data integration scenarios. In this document, we will guide you through the steps to send mail with attachments in Pentaho using a transformation and jobs.
Here are the steps:
Create a transformation which gives you any output file because we need this output file in the attachments when the mail sent.
Create a job, drag and drop transformation component and browse for the above created transformation. Add two mail components at the end for both when job is failed and succeed.
Give the connections as per the above mentioned screenshot.
Double-click on the ‘Mail’ step to configure it.
In the address tab mention the sender and destination email addresses as per the below screenshot. For testing purpose I am using same emails.
In the Server tab mention the SMTP server details, port and login details of sender as per the blow screenshot. Choose either ‘STARTTLS’ or ‘SSL/TLS’ depending on your SMTP server’s requirements.
In the Email Message tab enter the subject,content in the respective tabs and check the “Only send comment in mail body” option to avoid unnecessary messages in the email.
In the Attached Files tab, enable attach file message option and select “general” file type.
NOTE: The details are same in both mail components, only the subject and content will change. No need to do any changes in the “attached files” tab of second mail component because when the job is failed we won’t get any output file.
Run the job, if the job runs successfully then verify that the email with attachments has been sent successfully to the specified recipient.
Screenshot of email when Job Succeeded
Screenshot of Job and email when job is failed
By following the steps in this document, you can easily set up and configure a Pentaho transformation to automate the process of sending emails with attachments.
Helical IT Solutions
Best Open Source Business Intelligence Software Helical Insight is Here