cancel
Showing results for 
Search instead for 
Did you mean: 

Receiver Mail Adapter sending Attatchments to dynamic recipients

Former Member
0 Kudos

Hi,

I am using a Receiver Email Communication Channel. I need to be able to send emails to dynamically assigned recipients. I know I need to use the 'Use Mail Package' option. I am doing this and it is working. However, I also need to attatch the payload to the email. This will work by not specifying the 'Use Mail Package' option. I need to do both.

I can send an email with an attatchment. But the content of this attachment has been generated by a Message Mapping. I want the payload on the attchment.

Thanks

Martin

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Martin,

when you use the Mail Package format and assign your payload to the <Content> Element, it should be send as an attachement.

<?xml version="1.0" encoding="UTF-8"?>

<p2:Mail xmlns:p2="http://sap.com/xi/XI/Mail/30">

<Subject>My Mail</Subject>

<From>xi@mail.com</From>

<To>me@mycompany.com</To>

<Content_Type>text/xml;name="MyContent"</Content_Type>

<Content>...</Content>

</p2:Mail>

Hope this helps

Thomas

Former Member
0 Kudos

Hi Thomas,

How does the paylaod get attatched to the content though. That is the bit I cannot get working.

Thanks

Martin

Former Member
0 Kudos

I just used it with an CSV Content, but if create a datatype with the structure of the MailPackageFormat, you can map the content via a Java Mapping.

There maybe a problem with the tags in the payload.

Thomas

Former Member
0 Kudos

Did you create the Mail ( e.g. to, from, subject etc ) in the Java Mapping also.

Can this not be done in XI mapping.

Former Member
0 Kudos

U can do this in the XI mapping.

I use a Java Mapping to add the Message into the Content element. Thereafter I use a "normal" XI Mapping to add the rest (to, from, etc...) and the content is mapped 1:1 to the Content elemnt