File to mail scenario with dynamic email addess

Hi All,
I am doing a file to mail scenario with attachment(mail package is used), where i need to pick a file from folder and based on the file name(Country code is provided in file name. for eg. Collections_UK02_20091210.txt. here UK02 is the country code), i need to send an email to dynamically. I am using value mapping for country code with email address. please provide me suggestions like how can i pick the file based on the country name and send to the corresponding email address.
Regards,
Mahakrishnan T.

Hi Mahakirshanan,
>>how can i pick the file based on the country name and send to the corresponding email address.
You cannot do this.. better will be to make a generic interface which will pick the file and based on its filename it will make the to field
Follow these steps:
1 Read the file using communication channel (check the adapter specific identifiers)
2. Using dynamic mapping read the filename and based on the name of file decide the To address and update it to the To field of mail package. You can use value mapping to decide what the targetvalue can be.
Regards
Suraj

Similar Messages

  • File-xi- mail scenario with attachements

    Hi
    Can anybody tell me the real time use of file-xi- mail scenario with attachements ??
    thanks
    kumar

    Hi,
    >>>>Can anybody tell me the real time use of file-xi- mail scenario with attachements ??
    yes: your application puts order data into a file and generated a PDF file with it
    XI takes both and send order file in mail and PDF in mail attachment
    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>

  • File to mail scenario with zip file as an attachment

    Hi experts,
    I have a file to mail scenario.The mail contains a zip file as an attachment.
    The file in the input folder is a zip file. I want to send this zip file via email using mail adapter.How can i achieve this?Please help me to solve it out.
    Regards
    Divia

    Hi Narath,
    Do check the below link it will be helpfull
    Troubleshooting SOAP, HTTP and Mail Adapter Scenarios with TCPGateway
    Thanks
    Sampath

  • File To Mail Scenario With An Attachment

    Hi All,
    I Want to Implement a FileXI--Mail Scenario With An Attachment
    I Want to Send a Text File From the File System As An Attachment to the Mail.
    Can We Do this With out Doing JAVA Or XSLT Mappings in this ???
    Please Give me the Steps That I Have to Follow
    Regards
    Babu

    Babu,
    I am not sure how complex is your file sturcture and the mapping. But we can also achieve without java or xslt mapping also. Please check these weblogs:
    /people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
    /people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
    Also you have to use module swap for sending the attachment as txt file. Please check this weblog for this:
    /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d0964d7c-e66e-2910-24bb-ac535e4a5992
    Regards,
    ---Satish

  • Xml file to mail scenario with zip file as an attachment

    Hi experts,
    I have  a file to mail scenario. File is in xml format.
    At receiver side, first I want to zip this file and send the zip file as an attachment using mail adapter.
    How can i achieve this?
    Regards
    Divia

    Hi Shabarish,
    In the module tab i have specified the below beans
    localejbs/AF_Modules/MessageTransformBean                           contentType
    AF_Modules/PayloadZipBean                                                    zip
    sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean           mail
    In the module configuration i mentioned as
    Transform.ContentDescription   file
    Transform.ContentDisposition   attachment:filename="file.xml"
    zip.filenameKey                      contentType
    zip.mode                                zipOne
    Now i am getting the mail with zip file as an attachment.But the name of the attachment i got is MainDocument.zip
    Even the file name inside the zip is MainDocument.xml.
    How can i specify my own file name for both zip file and the file inside the archieve folder.Please help me.
    Regards
    Divia

  • Configuring Receiver mail adapter with dynamic email addresses

    Hi,
    I'm a newbie to XI and I have problems in configuring the Receiver mail adapter with the "Use Mail package" option selected. I am trying pickup a file (using file adapter on Sender side, picks up a simple XML file) and after mapping in XI, send the message as an email message to dynamic email addresses.
    Everything works fine if I did not select the "Use Mail Package". But when I choose that option it errors out. I followed this blog posted on SDN -
    /people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
    The following XML message is my source
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/Somenamespace">
       <ns0:Message1>
          <ns1:studentlisttest xmlns:ns1="urn:karthiksender_to_karthikreceiver">
             <Student>
                <studentid>1</studentid>
                <lastname>Studentlastname</lastname>
                <firstname>Studentfirstname</firstname>
             </Student>
             <Mail>
                <From>[email protected]</From>
                <To>[email protected]</To>
                <Subject>Test mail adapter</Subject>
             </Mail>
          </ns1:studentlisttest>
       </ns0:Message1>
    </ns0:Messages>
    What I want to accomplish is, I have a simple message mapping where the Studentdetails are mapped to, lets say Customer details. For convenience lets keep it simple, StudentId --> Customerid, (student)Firstname --> (customer)Firstname, (Student)Lastname --> (customer)Lastname
    I would like to get the Customer details as an XML attachment or in the body of an email with from, to and subject corresponding to that specified in the <Mail> node.
    I followed the instructions posted on the blog and it works fine if I don't map the studentdetails to customerdetails. I did multimapping, with one source message (the xml file I posted above) and two target messages (customerdetails and Mail, which is the external definition posted on the blog). I beleive I'm missing something here. Could somebody please guide me through this?
    Thanks
    Karthik

    hi,
    I still have not found the solution for this problem. Michal, your blog works fine when my source message has got only the mail details. As per your advice, I tried modified the structure of the xsd file as follows
    <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">
    <!--
    Mail
      -->
      <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:element name="CustomerlistExternal">
        <xs:annotation>
          <xs:documentation>Customer List</xs:documentation>
        </xs:annotation>
        <xs:complexType>
          <xs:sequence>
            <xs:element name="Customername" type="xs:string"/>
            <xs:element name="Customerid" type="xs:string"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>
    My source message will be something like
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
       <ns0:Message1>
          <ns1:studentlisttest xmlns:ns1="urn:karthiksender_to_karthikreceiver">
             <Student>
                <studentid>1</studentid>
                <lastname>abclname</lastname>
                <firstname>abcfname</firstname>
             </Student>
             <Mail>
                <From>[email protected]</From>
                <To>[email protected]</To>
                <Subject>Testing Mail adapter</Subject>
             </Mail>
          </ns1:studentlisttest>
       </ns0:Message1>
    </ns0:Messages>
    I have mapped the <student></student> information to customerlist, with customerid --> studentid and customername --> firstname or lastname (for symplicity). This was a multimapping with one source and two target messages. My test mapping output is
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
         <ns0:Message1>
              <ns2:Mail xmlns:ns2="http://sap.com/xi/XI/Mail/30">
                   <Subject>Testing Mail adapter</Subject>
                   <From>[email protected]</From>
                   <To>[email protected]</To>
              </ns2:Mail>
         </ns0:Message1>
         <ns0:Message2>
              <ns2:CustomerlistExternal xmlns:ns2="http://sap.com/xi/XI/Mail/30">
                   <Customername>abclname</Customername>
                   <Customerid>1</Customerid>
              </ns2:CustomerlistExternal>
         </ns0:Message2>
    </ns0:Messages>
    So how would I get this part of the <CustomerlistExternal></CustomerlistExternal> part of the message as an attachment to the mail address specified in the <ns2:Mail></ns2:Mail> tags.
    I'm definitely not understanding it right and am missing something. Could you give me step by step instructions to acheive this. I apologize for the trouble..this would be of great help to me.
    Thanks
    Karthik

  • How to configure receiver communication channel in File to mail scenario?

    Hi all,
            I'm working in FIle-to-Mail Scenario. I did all the required configuration In Integration repository. As per my Scenario whenever a text file stored in Application server of the R/3 system. it should be sent as a attchment with a mail.so i set a sender communication channel with file adapter in sender R/3 system . i dont know which business system should i refer for my receiver communication channel.because my receiver end is  a mail server. should i create any third party business system for this one?
    can anyone suggest me to define a receiver comm channel in a right manner?
    helpful answers will be rewarded.

    Hi,
    Check these
    /people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter
    /people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
    /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken]
    /people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
    http://help.sap.com/saphelp_nw04/helpdata/en/3c/b4a6490a08cd41a8c91759c3d2f401/content.htm
    Regards
    Seshagiri

  • File to Mail Scenario error

    Hi All,
                    I did file to mail scenario. The source structure contain the following elements like <to>....</to>, <Subject>........</subject> etc (the source structure created by me). In Integration Directory I set the Mail adapter Message protocol as "XIPAYLOAD" and Mail attribute "Use Mail Package" selected.  So here my scenario should send a mail to which has i given "To Id" in my source structure. But when i go to SXMB_MONI, I found my message as red flag and it is showing information like "thrown during application mapping". Here what is the problem and how can i rectify the problem, please any one help me, 
    Thanks & Regards,
    Satish,

    Hi,
    you should add your email address to your user,add specific users list add you r user in alrtcatdef.
    generally you should maitain the email data type format like
    subject,from,to,content-type..
    se below link
    http://help.sap.com/saphelp_nw2004s/helpdata/en/23/c093409c663228e10000000a1550b0/content.htm
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    /people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
    Regards
    Chilla..

  • File to mail  scenario

    In file to mail scenario how can we send a document/image as an attachment  along with the data?

    Go thru this link. It contains demos on how to work with Mail adapter
    https://www.sdn.sap.com/irj/sdn/docs?rid=/webcontent/uuid/110ff05d-0501-0010-a19d-958247c9f798#xi [original link is broken]
    Have a look at these weblogs ....
    /people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
    /people/sravya.talanki2/blog/2006/01/12/xi-triggering-e-mails-with-multiple-attachments--problems
    /people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
    Regards,
    Shabari

  • File to Mail scenario? File not received only namespace

    Hi,
    I tried to do file to mail scenario. I read blogs and forum questions before posting this.
    My problem is that I am sending.dat file in file to mail scenario.
    I used XIPAYLOAD and without Mail adapter
    When i received mail it contains attachement Untitled.xml and it does not contain my file data it contains only this.
      <?xml version="1.0" encoding="UTF-8" ?>
      <ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30" />
    I do not know how to create file with payload containing To, from subject, content things. I tried Michal blog and disabled unneccessary fields etc. and when i send email as file but now In RWB it gives error
    Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: java.io.IOException: no sender address specified
    regards
    hussaan

    Hi again,
    Simple message types and i use ximail30_xsd.txt from sap note as external defination
    Message mapping is also simple according to SDN TV.
    Adapter: Mail
    Transport Protocol: SMTP
    Message Protocol:XIPayload
    Adapter Engine: Integration Server
    smtps://smtp.googlemail.com:465
    Authetication Method: Plain
    User: complete email address
    Mail Attributes:
    From: email address
    To: email address
    Subject: test
    Content encoding: base 64
    Keep attachement: Option Checked
    No other change i did, With this configuration i receive email with untitled.xml attachement which contains only namespace info (no data).
    In my other try i changed message mapping and uses to create payload which michal refers by using constants(text to describe TO, from, subject) and text functions(concat)  in message mapping fields.
    Integration driectory setting for that
    Adapter: Mail
    Transport Protocol: SMTP
    Message Protocol:XIPayload
    Adapter Engine: Integration Server
    smtps://smtp.googlemail.com:465
    Authetication Method: Plain
    User: complete email address
    Mail Attributes: option checked
    Content encoding: base 64
    Keep attachement: Option Checked
    With this option it gives error in RWB that no sender  found
    Regards
    hussaan

  • File to Mail Scenario - Need help

    Hi all,
    I am trying a simple file to mail scenario in which i am using following data types .
    Source datatype -
    Scr_File_DT
    -- Root
    Material_no
    Plant
    Target datatype -
    Tgt_Mail_DT
    --Content
    In the message mapping i am concatenating material_no and plant and mapping it to content.
    The receiver mail adapter parameters are as follows -
    Transport protocol - SMTP
    Message Protocol - XIPAYLOAD
    URL: smtp://gmail.com
    Configure User Authentication: X (Check box is selected)
    Authentication Method: Plain (from drop-down box)
    User: [email protected]
    Password: ****
    from: mail address
    to: mail address
    subject : test mail.
    Just wanted to confirm whether these settings are correct or not? Because i am not getting the mail in my mailbox.
    Can anyone please help me on this.
    Also are there any other settings required for using mail adapter ?
    Thanks.

    Hi,
    you should add your email address to your user,add specific users list add you r user in alrtcatdef.
    generally you should maitain the email data type format like
    subject,from,to,content-type..
    se below link
    http://help.sap.com/saphelp_nw2004s/helpdata/en/23/c093409c663228e10000000a1550b0/content.htm
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    /people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
    Regards
    Chilla..

  • Erro in file to mail scenario

    Hi all
    In file to mail scenario, i m getting a error
    com.sap.aii.af.ra.ms.api.DeliveryException: com.sap.aii.messaging.util.XMLScanException: illegal value in {}Date
    my input message to the adapter is
    <ns0:Mail encoding="" xmlns:ns0="http://sap.com/xi/XI/Mail/30">
       <Subject>hi</Subject>
       <From>[email protected]</From>
       <To>[email protected]</To>
       <Reply_To>[email protected]</Reply_To>
       <Content_Type/>
       <Date>12122007</Date>
       <Message_ID/>
       <X_Mailer/>
       <Content>dfdfdfdf</Content>
    </ns0:Mail>  
    Any idea where i have gone wrong?

    Hi,
    Try to send data with using the date feild if it works then probelm with the date format.
    What is ur scenario.u can directly hard code the TO,FROM and other valus in mial adapter na.....
    Can u be clear on ur senario so that i can help.
    Regards,
    phani

  • File - XI - Mail Scenario. ( Urgent Issue )

    Hi ,
    Good Morning...
    I am doing File to mail Scenario.
    I am Using File & Mail Adapter.
    I got 5 files in FTP server named as
    SAP1.txt
    SAP2.txt
    SAP3.txt
    SAP4.txt
    SAP5.txt
    Now File adapter should pick this 5 files and make a attachments  to a single mail.
    I am able to pick one file and attach and send it to the mail.
    But now i have to pick all te files and attach to the single mail with same file names like in source.
    How should i proceed for the scenario.
    Points will be awarded.
    Regards,
    Jayasimha Jangam

    Hi Jangam,
    ur having many files should be maped under one file and then send to a mail adapter
    it better to go with BPM is there any any common value in all the files
    pls do chk out this blog
    /people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
    /people/community.user/blog/2006/09/07/email-reporting
    /people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6d967fbc-0a01-0010-4fb4-91c6d38c5816
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken]
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d0964d7c-e66e-2910-24bb-ac535e4a5992
    /people/community.user/blog/2006/09/08/email-report-as-attachment-excelword
    /people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter
    pls do  chk this links they r mainly blogs
    if found worth pls do the req
    Thanx
    Sampath

  • Sending an excel sheet of  to mail Ids using file to mail scenario

    Hello,
    I have a folder with three folders archive exception and log. Log folders have the details of exception. I want the XML files that are in Exception, to be sent to resp email ids with the data in it to be stored in an excel sheet( data will be collected from the log file for the correspondng file in exception).
    eg: if test.xml is in exception its log will have an exception detail somethng like " Enter a value".
    In this case i want to give the exception details as well as some relevant details with it like material number etc , time at which the exception occured . These details are to be given in an excel sheet .
    Is it possible to do using file to mail scenario. Please help by explianing the procedure.
    Regards.

    This can be done with the help of some Java and ABAP coding. I can give you a general view on how to do this.
    1. Configure a file adapter for sender to pick up the exception files.
    2. While doing the mapping, create a UDF to store the values (which you need to send it to excel file) in a table in ABAP Stack.
    3. Create a ABAP Program in R3 (which can be schedule on regular intervals depending on ur req) to create an excel sheet based on the the data in the table (created in previous step). I am not sure how easy to code ABAP program to create an excel sheet.
    4. Create one more file adapter to send this excel sheet to the corresponding mail ids.
    This is a very high level view on doing this.

  • Error in File to Mail Scenario

    Hi All,
      I am getting the following errror at adapter level in File to Mail Scenario in XI production
    Mail: error occured: com.sap.aii.af.ra.ms.api.RecoverableException: java.io.IOException: server not responding OK to RCPT TO; 554 Relay access denied
    In XI development the scenario is working fine. I also checked with basis people for the configurations of the two servers and it is same.
    Can any one suggest the possible ways to solve the above error.
    Regards
    Prakash

    Hi All,
       I tried with one more SMTP server in both development and production , In development mail is going. But in production i am facing the following error in receiver adapter.
    Mail: error occured: com.sap.aii.af.ra.ms.api.RecoverableException: java.net.ConnectException: Connection refused
    Exception caught by adapter framework: java.net.ConnectException: Connection refused
    Delivery of the message to the application using connection Mail_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: java.net.ConnectException: Connection refused.
    Kindly provide some solution to solve the above errors.
    Regards
    Prakash

Maybe you are looking for