TIBCO Send Mail With PDF Attachment: Step By Step Tutorial

By | July 2, 2015

After going through my step by step tutorials on how to use Send Mail activity in TIBCO designer to send an email and also how to send email with multiple attachments in TIBCO; some people asked me to write a tutorial on how to send a PDF as an attachment using TIBCO Send Mail activity. In this step by step tutorial; I am going to explain how we can send PDF documents as attachments from our TIBCO BW processes using SendMail activity.

Business Scenario:

We need to create a simple BW process which takes the name of a user as input and then based on that input; selects a particular PDF file and sends it as an email attachment to a particular email address.

Let’s proceed step by step with this tutorial.


Step 1: Create a Process with Start activity expecting a String Input

In TIBCO designer; create a new process. In the Start Activity Output Editor; add a new String Element to get UserName value as input as shown below:

start activity output editor string element



Step 2: Add a Mapper for Choosing PDF File

For this example case; I have two pdf files already created with the names ajmal.pdf and abbasi.pdf. We need to choose the file based on the UserName that we receive as input of our start activity. For this purpose; I am adding a Mapper with a String Element named “FileName” in its input editor as shown below:

mapper input editor tibco


In the Input tab of this mapper; I have put the conditions to choose the file ajmal.pdf or abbasi.pdf based on the Input received as you can see in below screenshot:

tibco mapper input mapping screenshot



Step 3: Configure Send Mail Activity to Send PDF attachments

This is the main step of our tutorial. From the Mail Palette; add Send Mail activity in the process. In the Configuration Tab; specify the SMTP host that you have rights to use. In the Input tab of Send Mail activity; specify Sender and Receiver Email addresses, Email subject. In the MimePart, content-type in the MimeHeaders should be “application/pdf” for sending PDF attachments. In the fileName, map the name of the file from the mapper output as shown below:

tibco send mail input mapping pdf attachment


Step 4: Test the Process with Designer Tester

The last step is to test the process after validating it. Load the process in designer tester and run it by giving it input (if you input UserName as ajmal, you should receive ajmal.pdf as an attachment otherwise abbasi.pdf should be received).
I ran the process and I have received an email with PDF attachment in the inbox of the email address specified in “to” field of Send Mail activity input.

send mail pdf attachment test



Ajmal Abbasi

Ajmal Hussain Abbasi is Integration Consultant By Profession with more than 7 years experience in TIBCO products. He has extensive practical knowledge of TIBCO Business Works, TIBCO Spotfire, TIBCO BE, EMS and TIBCO ActiveSpaces. He has worked on a number of highly critical integration projects in Telecom sector by using his skills in Tibco Designer, Adapters, TIBCO EMS, RV, Administrator, TIBCO BE, TIBCO ActiveSpaces etc.
Ajmal Abbasi is also experienced in developing solutions using Oracle PL/Sql, Linux and Java.
You can contact Ajmal Abbasi for Consultancy, Technical Assistance and Technical Discussions.

More Posts - Website - Facebook - LinkedIn

3 thoughts on “TIBCO Send Mail With PDF Attachment: Step By Step Tutorial

  1. Krishna Vengalasetty

    Hi Ajmal,

    write a tutorial on how to use RV type as Distributed Queue. Advance Thanks…

  2. Anushka

    I have tried the same example. but while running it through tester, I’m getting .pdf is not a valid base64Binary.
    I have checked everywhere but i didn’t set the pdf file as binary anywhere.
    Could you please help

  3. varun

    @Anushka.. Try to select textContent in “Edit Statement” instead of binaryContent


Leave a Reply

Your email address will not be published. Required fields are marked *