cancel
Showing results for 
Search instead for 
Did you mean: 

How to send a file as mail attachment

Former Member
0 Kudos

Hello,

I have a xml message with three tags:

- receiver: email address of the destination

- subject: description of the message

- file: location of the file, containing directory and filename.

The file is a .pdf and is located on the XI server.

I want to sent the file as attachment via the mail adapter. Because the size of the file, I don't want to get the file through the IntegrationEngine.

Is there a simple, straightforward solution to let the Mail adapter pick up the file?

Thanks,

Peter

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

If u want toSend a Mail with Attachment

If you want to send a mail with a body and attachment, or with several attachments, the

message sender has to provide an XI message with additional attachments. For each

additional payload of the XI message, the mail adapter creates an attachment for the

mail. To enable this feature, you select the Keep Attachments checkbox when

configuring the mail adapter. By default, the payload of the message is also sent as an attachment. If you do not want the payload to be sent as an attachment, set

ContentDisposition to inline.

If you want to give each attachment a certain name, you can use the swap module. The

swap module changes the main payload.

Enter the localejbs/AF_Modules/PayloadSwapBean module as Local

Enterprise Bean between the two modules that change the attachment names.

Select a value for Module Key. Use this module key to create the following two lines in

the Module Configuration:

swap.keyName payload-name

swap.keyValue <Name of the Payload>

You can find the name of the payload that you want to set as the main payload in the XI

message monitor (SXMB_MONI).

Regards,

Phani

Reward points if Helpful

Former Member
0 Kudos

Hallo Phani,

Thanks, but the point is, that the filecontent is not a part of the payload. The filename and location are given in the payload. I have to swap the file to the attachment.

Regards,

Peter

Former Member
0 Kudos

Hi Peter,

refer to the following blog:

[https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1798] [original link is broken] [original link is broken] [original link is broken];

[https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1361] [original link is broken] [original link is broken] [original link is broken];

Award points if useful

Regards,

Yashaswee.