Skip to Content
Technical Articles
Author's profile photo Sanjana Satyan

SAP Cloud Integration(CPI): Customizing Email using Mail Adapter

Dear Reader,

This is my first blog post and through this article I would like to share my experience on designing custom email templates using the mail adapter in SAP Cloud Integration.

Cloud Integration has multiple Connectivity Adapters (technical protocols used to connect a sender or receiver to the tenant) such as Amazon Webservices, Ariba, Facebook, HTTPs, JDBC, Mail, SOAP, Twitter and various other adapters, which can be used depending on the scenario.

In this blog post, I shall explain how I designed my own Custom Template for sending emails using the Mail Adapter.


In the IFlow, I have used:
1) Start Timer: to trigger the message the moment the IFlow is deployed.

2) Content Modifier: to call the elements in the body of the email.
    Header as, ${header.elementName}
    Property as, ${property.elementName} and
    Message Body as ${in.body} in the subject/body of the email.

In the Operate and Monitor Integrations Scenario tab–>go to Security Material, and add User Credentials:

Security%20Material Security Material

Enter the User ID, and password of your Outlook account, and Deploy(Please ensure that your ID is unblocked for API mail sending)

User%20CredentialsUser Credentials

For Mail Adapter connection details that need to be maintained refer to the screenshot below:

Connection%20DetailsConnection Details

1) Address: maintain the address as where, is the address which allows the sender to check the domain of the sender through the email ID provided, and 587 here is the port behind the SSL certificate for security.

Similarly can be used only for Google Customers i.e. Gmail users. If you wish to use other Mail ID’s, you can make the necessary changes and ensure that you use the standard port. These are the different standard ports used by Google, Microsoft, Yahoo, Rediff and GoDaddy respectively 587, 465, 995, 993 and 25.

2) Credential Name: use the same name that is maintained in the Security Material.

3) Mail Attributes: mention the ID which has been unblocked for API mail sending and in the recipient section multiple addresses can be added which are separated by (; or ,)

In the Subject, and Mail Body enter your Email context. You can also call the Header, Property, and Message Body of the Content Modifier using ${in.body}

Mail%20AttributesMail Attributes

HTML Sample Code For the Customized Email Template:

<img align="right" src="" "width="60" height="60" alt="img"/>
<style="color:#000000;font-size:15px">Hello Team,</i></br><p/>
<style="color:#000000;font-size:15px">This email is to..</br>
<i style="color:#000FFF;font-size:15px">(Content)</br><p/>
<i style="color:#000000;font-size:16px">Thanks & Regards,</i></br>
<i style="color:#000000;font-size:16px">Signature.</i></br>
<a href="">Website</a>
<table style="width:73%">
<tr><td style="background-color:#00BFFF;color:white"><b>CPI Tenant:</b></td><td>${property.CPI_Environment}</td></tr>
<tr><td style="background-color:#1E90FF;color:white"><b>Date:</b></td><td>${date:now:yyyy-MM-dd}</td></tr>
<tr><td style="background-color:#00BFFF;color:white"><b>Time:</b></td><td>${date:now:hh:mm:ss}</td></tr>
<tr><td style="background-color:#1E90FF;color:white"><b>Message ID:</b></td><td>${header.SAP_MessageProcessingLogID}</td></tr>
<tr><td style="background-color:#00BFFF;color:white"><b>Integration Flow Name:</b></td><td>${camelId}</td></tr>
<tr><td style="background-color:#1E90FF;color:white"><b>Exception Message:</b></td><td>${exception.message}</td></tr>

After you deploy the IFlow, a message shall be triggered, and you shall get an Email like the template attached below:

Customized Email

Hope this was informative 😊

You can also check out these links related to configuring the Mail Sender and Receiver Adapter:

If you have any further queries on the customization mentioned or mail adapter configuration, please feel free to drop a comment below.

You can also post your questions on

Best Wishes,
Sanjana Satyan

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Sookriti Mishra
      Sookriti Mishra

      Welcome to the world of blogging. 🎉

      Keep them coming. ❤

      Author's profile photo Sanjana Satyan
      Sanjana Satyan
      Blog Post Author

      Thank you Sookriti Mishra ❤​​​​​​​

      Author's profile photo surendra kumar
      surendra kumar


      Thanks for the above IFLOW. In this case do we need get outlook certificates?. As i dont see any certificates for Outlook that are displaying.

      Author's profile photo Sanjana Satyan
      Sanjana Satyan
      Blog Post Author

      Hi Surendra,

      I have not used any Outlook Certificates while designing the IFlow.

      Author's profile photo Jonathan Prow
      Jonathan Prow

      Thank you for sharing the blog.  FYI - minutes and months are backward in sample code 🙂




      Author's profile photo Sanjana Satyan
      Sanjana Satyan
      Blog Post Author

      Thanks, yes hadn't noticed that.

      Author's profile photo Mastan Vali
      Mastan Vali

      Hi Sanaja,


      Good blog.

      you could have showed how you maintained the entries in CM......its just a suggestion.




      Author's profile photo Sanjana Satyan
      Sanjana Satyan
      Blog Post Author

      Thanks 🙂

      Author's profile photo Ankit Pallav
      Ankit Pallav

      Can we use use subject rtl?

      Author's profile photo Sanjana Satyan
      Sanjana Satyan


      Author's profile photo Jay Bhambhani
      Jay Bhambhani

      Thanks for the informative blog Sanjana.

      I am getting the following error:

      LastError = com.sun.mail.util.MailConnectException: Couldn't connect to host, port:, 587; timeout 30000;

      nested exception is:, cause:
      LastErrorModelStepId= MessageFlow_8


      Please assist.



      Author's profile photo Sanjana Satyan
      Sanjana Satyan

      Hi Jay,

      Did you check whether the SMTP server and port are correct?


      Author's profile photo 信豪 何
      信豪 何



      javax.mail.身份验证失败异常: 535 5.7.3 身份验证失败 [ 2023-08-14T11:03:11.413Z 08DB9A849A4BD8B9]

      LastErrorModelStepId= MessageFlow_8









      Author's profile photo Allen Chen
      Allen Chen


      Could you share a screenshot of your error?  It seems I meet similar error but using gmail.

      Author's profile photo 信豪 何
      信豪 何

      Sorry, I am unable to log in to the customer system to reproduce this issue. I was unable to handle this issue at the time and have already used a different method of handling it. If there is a solution, please let me know and avoid taking any further detours. Thank you very much.

      I am no longer able to provide a screenshot of the problem, but the description of the problem is as follows:

      Javax. mail. Authentication Failure Exception: 535 5.7.3 Authentication Failure [TYAPR01CA0155. jpnprd01. prod. 2023-08-14T11:03:11.413Z 08DB9A849A4BD8B9]LastErrorModelStepId=Message Flow_ eight