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:
STEP1:
Create a transformation which gives you any output file because we need this output file in the attachments when the mail sent.
STEP2:
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.
STEP3:
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.
STEP4:
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.
Step5:
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
Conclusion:
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.
Thank You
Vani Bolle
Helical IT Solutions
Best Open Source Business Intelligence Software Helical Insight is Here
Hi, I am having a similar problem. I read from a file in one transformation, later I write to an excel file. For some reason, Pentaho is sending the file I read in the earlier step AND the file I want to send. In the email step, ONLY the excel file is named. It is bizarre. I have restarted my PDI etc and it still happens.