cancel
Showing results for 
Search instead for 
Did you mean: 

Mial Package with Attachments

Former Member
0 Kudos

Hi All,

We have setup the mail package and created the appropriate message maps where we now send emails out from XI for certain message types. This works great but we want to also send document attachments with our current message. If I check the keep attachments option on the mail package the outputted email tries to put the attachment in the body of the email and the original body text into an email attachment. This is completely reverse of what I am trying to do. I looked through several threads and used Michal Krawczyk's blog to get this far.

I noticed the documentation had this to say, "If you have selected XIPAYLOAD as the message protocol and you want to forward XI attachments in the e-mail attachments, select Keep Attachments. You use the PayloadSwapBean module to swap the application payload with one of the attachments."

I tried a couple of options for the PayloadSwapBean but my results never changed. I could have several attachments so I can't hard code what attachment type or extension.

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

hi,

why do you use mail package? any reason for that ?

Regards,

michal

-


<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

Former Member
0 Kudos

Hi Michal,

We use the mail package because we map the ToAddress, Subject and Body from another message interface. We have a message type called PurchaseOrderRequest which we map to the Mail message. This mapping uses the PO document to populate the email fields. This works great thanks to your blog and every time certain POs are created in our system we email something out to the user. We wanted to take this one step further and send out any attachments that may have been included on the original PO document.

We are new to this whole emailing from XI piece so we will use something other than the mail package if it makes since.

Any help would be appreciated

Regards

Joe

MichalKrawczyk
Active Contributor
0 Kudos

hi,

>>>>We are new to this whole emailing from XI piece so we will use something other than the mail package if it makes since

that what I was trying to find out:

"ToAddress, Subject and Body"

if you just use it to set ToAddress, Subject there's no need to use mail package

you can use mail adapter dynamicparameters

(they will allow you to set ToAddress - THeaderTO , Subject - THeaderSUBJECT)

you can set them easily in the mappin step (graphilca mapping)

and then I believe the attachments will work

(if not you can always use a little adapter module to control them)

but try without the mail package first as from SP14

it doesn't make sense to use it

Regards,

michal

-


<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

Former Member
0 Kudos

Hi Michal,

Let me see if I have this right. I currently have a mapping from PurchaseOrderChangeRequest to Mail, which I assign the To, Subject and Content. I can keep this mapping but instead of the direct mapping I would map each required field to a UD function as explained in /people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping and correlate this to the root node. Then I could go into my Mail Adapter Communication channel and select "use adapter specific messaging attributes" and disable "use mail package". The technical names I would use are ToAddress, THeaderTO and THeaderSUBJECT?

Cheers,

Joe

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

you can change the mapping as you won't need the mail package format

if you want

Regards,

michal

Former Member
0 Kudos

Looks like I am getting close:

I have the following in my dynamic configuration now in SXMB_MONI:

<SAP:DynamicConfiguration xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">

<SAP:Record namespace="http://sap.com/xi/XI/System/Mail" name="THeaderFROM">errors@myemail.com</SAP:Record>

<SAP:Record namespace="http://sap.com/xi/XI/System/Mail" name="THeaderTO">joe@myemail.com</SAP:Record>

<SAP:Record namespace="http://sap.com/xi/XI/System/Mail" name="THeaderSUBJECT">The attachments for PO are included in this email.</SAP:Record>

</SAP:DynamicConfiguration>

The MDT gives me the following error when trying to send email: Mail: error occurred: java.io.IOException: no sender address specified

Regards,

Joe

Former Member
0 Kudos

I found out why I was getting the no sender address error. It turns out that even though you are doing dynamic configuration for email address and subjects, you still have to put a value in the communication channel mail attributes. I now have my emails going out and with XIALL selected I get my message and document attachments on the email as attachments.

The only odd thing I have remaining is the SOAP Header now shows in the body of my email.

Cheers

Answers (0)