• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

riyaz.net

Tech Tips and Tutorials for SAP Professionals and Bloggers

  • Home
  • WordPress
  • Tips & Tricks
  • Internet
  • SAP
    • SAP PI
    • SAP ABAP
  • Personal Finance
  • Health & Fitness
  • Travel & Leisure
You are here: Home / SAP / XI/PI: Sending Emails Using XI Mail Adapter

XI/PI: Sending Emails Using XI Mail Adapter

February 23, 2008 by Riyaz

In this article we shall discuss the configuration of SAP XI Mail Adapter on the receiver side. The receiver mail adapter resides on the J2EE stack and converts the XI messages into emails and transfers them to email server or in simple words sends them as emails to intended recipient(s).

The adapter supports SMTP as well as IMPA4 protocol. Message protocol provides two options, namely XIALL and XIPAYLOAD. In the former entire SOAP message is sent as an attachment in mail along with the payload while in the latter only the message payload is sent.

Configuring the Receiver Mail Adapter

Let’s say you want to send incoming XML message as an email. The mail adapter provides two options – one using the mail package and one without using mail package. When you do not use mail package you have to provide the email header details (like To and From addresses, Subject line etc) in the adapter itself. There is no restriction on the XML message format or namespace. However, when you use mail package, you have to adhere to a specific format of the source XML.

The figure above on the left shows a typical message structure that should be used while configuring receiver mail adapter with mail package. The Message Type must be named as ‘Mail’ and it must be present under the Namespace ‘http://sap.com/xi/XI/Mail/30’. Your message is bound to fail in adapter engine if this is not adhered to. This helps you to dynamically set email parameters like sender, receiver mail subject etc.

The URL of the mail server should be specified as shown below depending on whether you use SMTP or IMAP4.

smtp://EmailServer or imap://EmailServer/UserInbox

If your server required User Authentication, you can specify the same while configuring the adapter. If you want to request a delivery receipt, check the ‘Send Delivery Status Notification’ checkbox. The delivery receipt is delivered to the email address specified in the ‘To’ field. base64 content encoding is possible. The figure on the right shows a typical configuration of the receiver mail adapter.

The output using the mail package is as shown below:

If you do not use mail package, the XI message will be sent to the static addresses as specified in the receiver mail adapter configuration. A typical output is shown below:

If you use XIALL as Message Protocol, the entire SOAP message is sent as an email attachment along with payload as shown below.

The first attachment in the email message shown above is the SOAP message while the second attachment is the actual payload.

As with any other J2EE adapter, you can enhance the adapter further using the adapter modules which can be specified in the module tab of the communication channel. This article discussed the simplest way to work with mail receiver adapter in order to send mails from XI server.

Filed Under: SAP Tagged With: SAP PI

About Riyaz

Riyaz Sayyad is the founder of Riz Labs. Learn more about him here.

Primary Sidebar

Popular Guides

  • Dropbox Tutorial
  • CDN Setup Guide
  • Blog Design Tips
  • Optimize RSS Feed
  • Create Twitter App
  • Short URLs
  • Password Protect Folders
  • Time Management
  • ALE IDocs Tutorial
  • SAP PI Starter Kit
  • SAP PI Tips
  • Ergonomics

Popular Topics

  • Home
  • WordPress
  • Tips & Tricks
  • Internet
  • SAP
    • SAP PI
    • SAP ABAP
  • Personal Finance
  • Health & Fitness
  • Travel & Leisure

About Riyaz

riyaz.net is a popular technology site with how-to guides, tips and tutorials on personal technology, blogging, social media, web apps, personal finance and SAP.

riyaz.net was launched way back in 2005 by web designer, blogger and SAP Consultant Riyaz Sayyad from Pune, India. Over the years the site has grown into a full featured online community with thousands of visitors daily from around the world. Read more.

Copyright © 2025 · riyaz.net