cancel
Showing results for 
Search instead for 
Did you mean: 

File-Mail Scenario

Former Member
0 Kudos

Hi ,

I am doing File to mail scenario.

I have 5 files in FTP Server ( sap1.txt , sap2.txt , sap3txt , sap4txt , sap5.txt)

I need to attach all the files to single mail and send the mail to receipient.

I an not using IR simply configuring the adapters in ID.

I am able to attach single file and sending , But how to attach all the files in a single mail and send it.

Kindly help me for the scenario.

" Points will be awarded "

Regards,

Jayasimha Jangam.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi

You can do it by Java mapping

XI Mail Adapter: An approach for sending emails with attachment with help of Java mapping

/people/stefan.grube/blog/2007/04/17/xi-mail-adapter-an-approach-for-sending-emails-with-attachment-with-help-of-java-mapping

Refer

/people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step

Here only one attachment is sent but you can send it one by one (in a loop) from adapter module just check sample adapter modules code from SAP in this blog and you will find how to do it

also refer

XI: Triggering e-mails with multiple attachments

/people/sravya.talanki2/blog/2006/01/12/xi-triggering-e-mails-with-multiple-attachments--problems

thanks

sandeep

if helpful reward points

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello ,

Check this

For Details refer blog on "Scenario without IR"

/people/william.li/blog/2006/09/08/how-to-send-any-data-even-binary-through-xi-without-using-the-integration-repository .

************Reward points,if found useful

sunil_singh13
Active Contributor
0 Kudos

Hi Jayasimha,

in file name attribute of file adapter give the file name as *.txt so that it will pick all the file with. txt extention and all be sent as a attachment.

Reward Points if helpful

Thanks

Sunil Singh

Former Member
0 Kudos

Hi sunil,

In this case it will pick one file at a time and attach one file and send it.

In My scenario it should pick above files ata time and send it as single Mail.

former_member183906
Active Contributor
0 Kudos

Hey,

you can use dynamic addressing wherein you can provide the mail related information in your mapping.

for example the to, from, subject and content.

so you can map these fields form the input structure or you can have a constant to map it.

refer to this blog it will really help.

/people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address

the only differerence in your case is that you need file as attachment so mark the keep attachment field.

it will ask you for a mail structure.

use this structure as your target structure.

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

<xs:schema targetNamespace="http://sap.com/xi/XI/Mail/30" xmlns:xi="http://sap.com/xi/XI/Mail/30" xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="Mail">

<xs:annotation>

<xs:documentation>Mail package for XI - Mail Adapter</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:sequence>

<xs:element name="Subject" type="xs:string" minOccurs="0" />

<xs:element name="From" type="xs:string" minOccurs="0" />

<xs:element name="To" type="xs:string" minOccurs="0" />

<xs:element name="Reply_To" type="xs:string" minOccurs="0" />

<xs:element name="Content_Type" type="xs:string" minOccurs="0" />

<xs:element name="Date" type="xs:dateTime" minOccurs="0" />

<xs:element name="Message_ID" type="xs:string" minOccurs="0" />

<xs:element name="X_Mailer" type="xs:string" minOccurs="0" />

<xs:element name="Content" minOccurs="0">

<xs:annotation>

<xs:documentation>any type</xs:documentation>

</xs:annotation>

</xs:element>

</xs:sequence>

<xs:attribute name="encoding" type="xs:string" />

</xs:complexType>

</xs:element>

<xs:element name="MailReceipt">

<xs:annotation>

<xs:documentation>Mail Receipt for XI - Mail Adaper</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:sequence>

<xs:element name="Server" type="xs:string" />

<xs:element name="Format" type="xs:string" />

<xs:element name="UseMailPackage" type="xs:boolean" />

<xs:element name="Encoding" type="xs:string" />

<xs:element name="Subject" type="xs:string" minOccurs="0" />

<xs:element name="From" type="xs:dateTime" minOccurs="0" />

<xs:element name="To" type="xs:string" minOccurs="0" />

<xs:element name="Date" type="xs:dateTime" minOccurs="0" />

</xs:sequence>

</xs:complexType>

</xs:element>

</xs:schema>

reward points if useful.

regards,

Former Member
0 Kudos

Hi Vijay Thank u for replying,

I am able to attach the a single file and send it.

My Problem is i have to attach 5 files and send a mail.