Using mail package in file to mail scenario

For sending the mail in proper email format ,
we have to check the USE MAIL PACKAGE option.
the corresponding  TO, FROM ,SUBJECT and CONTENT
need to be handled in mapping..
Can anyone tell me which field in the mapping will match the req fields ????

<ns:Mail xmlns:ns="http://sap.com/xi/XI/Mail/30">
<Subject>Hello</Subject>
<From>[email protected]</From>
<To>[email protected]</To>
<Content>row1
row2
row3
row4</Content>
</ns:Mail>
You can use UDF example to do this. Assume your original message payload is:
<root>
<text>row1</text>
<text>row2</text>
<text>row3</text>
<text>row4</text>
</root>
Create a advanced user defined function like this:
public void AddText(String[] a, ResultList result, Container container){
codeString b = "";
for (int j=0;j<a.length;j++)
b = b + a[j] + "\n";
result.addValue(b);[/code]
Now you connect
text -> addText -> Content

Similar Messages

  • Unable to get source file content as mail body in file to mail scenario

    Hi Friends,
    I am facing one problem with one of my file to mail scenario in PI(SP9).  I have done bypass scenario(without IR only with ID objects). Scenario is working fine, i am getting mail also.  But my requirement is i want complete source file content as a mail body (not xml format, text format).  I have checked all options, but configured scenario bydefault taking source content as a attachment and mail body is empty.  I have tested below options
    1. If i choose message protocol as FCC mechanism at source side content at target side i am getting xml format as a attachment( In mail adapter i have selected message protocol as xi payload, and without packate option on mail adapter). If i choose message protocol as xi all, i am getting 2 files as a attachment (one file as a payload content and second file as a source file content in xml format).
    2. If i choose message protocol as file at souce side that time i am getting source complete content as a attachment at target side in xml format, but mail attached file content is flat file(.xml extension) format. When i tried to open attachment file that time i am getting error in explorer, but i can see only one row in explorer  remaining rows unable to see.
    Please share your ideas on this.

    Hi,
    Follow below steps
    1. First basis level need to configure setup(SMTP) for mail.  After that only mail will go from SAP.
    2. Source side depending on requirement take communication channel(idoc, file etc)
    3. Receiver side communication channel take mail adapter and configure below setup
       3.1 select message protocol XI ALL/ XI PAYLOAD(WITH PACKAGE or WITHOUT PACKAGE)
       3.2 if message protocol is XI ALL, the complete content will be sent as a attachment along with payload file
       3.3 if message protocol is XI PAYLOAD, the source message, the source message will be sent as attachment.  Playload file filter automatically.
       3.4 If you use PACKAGE option on mail adaper, this time source strucute need to import from SAP (some standard structure only will be support, without strucutre we can't work).  If you choose package option no need to give mail id on communication channel, we need to pass mail id's from source structure.
    I hope now clear.

  • E-Mail reporting in file to mail adapter scenario

    Experts,
       I am working on a file to mail adapter in which, have to just send a mail to the recipient by  putting a subject line and mail body.
    am following the following example
    /people/community.user/blog/2006/09/07/email-reporting
    but my requirement is not to send the mail attachment. I just need to send a mail body stating the error location.
    here at teh receiver side, have downloaded a mail.xsd. in this "subject line","from field" , "to" field is there but there is no "mail body" field .
    Can any one please help me out. I just require to send a mail body to the recipient.
    Thanks
    Veeru

    Expert,
       I have used but still am getting teh attachment not as a mail body.
    Isit possible to send the mail body via XSLT mapping , for eg
    <?xml version='1.0'?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://perks.com/MailTest">
      <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
        <xsl:template match="/">
       <ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30">
        <Subject>Error files from XI</Subject>
        <From>from mail ID</From>
        <To>to mail id</To>
        <Content_Type>text/html</Content_Type>
        <Content>
         <xsl:text xsl:space="preserve">The error files for which service entry has not been created:</xsl:text>
         <xsl:value-of select="$break"/>
         <xsl:value-of select="$break"/>
         <xsl:value-of select="$tableB"/>
         <xsl:value-of select="$thB"/>
         <xsl:value-of select="$tdB"/>
         <xsl:text xsl:
        </Content>
       </ns1:Mail>
      </xsl:template>
    </xsl:stylesheet>
    Any suggestions?
    Thanks
    Veeru

  • Send output types by mail as atteched file with mail text

    Hello,
    I need to send an invoice by E-mail. A psecific output type has been created (transmission meium 5).In NACE section ''Mail title and texts'' is processed (Texte created and Document title created).
    When I generate this output type in the invoice, the mail is sent to the partner defined in NACE but the mail contains only the invoice in pdf format, and no mail text.
    How can I send a text at the same time as the pdf file?
    Thanks.
    Benjamin

    I konw the way to send mail using function modules with pdf file as attachement.
    What I want to do is to use an ouput type with communication medium 5 and to add a text in the mail.
    Benjamin
    Edited by: Benjamin CABOT on May 11, 2009 1:30 PM

  • How to use a packaged Jar File?

    Greetings to everyone reading this post!
    I have a query about a thing that seems to be basic but I don't know how to accomplish, here it goes:
    I have packaged a Simple application into a Jar file. this application contains a package like this:
    lib.demo, inside this package I have a Class named MyClass with some simple methods like this one:
    public void sayHi(String name){
    //implementation here
    }Now, I would like to Know how to use the Method sayHI(String name) from an entirely different Project. I have successfully included the Jar File as a Library(in the new Project), but I have I no Clue on How to invoke a Class inside my Jar library, and more Importantly, a method.
    Could anybody help me?

    if the "project" (not a Java-related system, it's IDE-specific) already includes the JAR file in its classpath (library), then all you need is to import the package/class and invoke the method, as such:
    // in your client code:
    import lib.demo.*;         // or, import lib.demo.MyClass;
    public class Test {
      public void inAMethod() {
        MyClass myC = new MyClass();
        myC.sayHi("say hi"); 
    }simple.

  • Error while sending a mail using UTP_MAIL package in Oracle 10g

    Hi,
    We are using UTP_MAIL package to send a mail from Oracle 10g.We have follwed the following steps ...
    SQL> connect sys/password as sysdba
    Connected.
    SQL> @$ORACLE_HOME/rdbms/admin/utlmail.sql
    Package created.
    Synonym created.
    SQL> @$ORACLE_HOME /rdbms/admin/prvtmail.plb
    Package body created.
    SQL > alter system set smtp_out_server = '<mail_server_ip:25>' scope =spfile;
    System altered..
    Now we try the code
    begin
    utl_mail.send(
    sender => 'sender's mail',
    recipients => 'receiver mail',
    CC => 'optional',
    subject => 'Testing utl_mail',
    message => 'Test Mail'
    end;
    But we get the following error...
    ERROR at line 1:
    ORA-29278: SMTP transient error: 421 Service not available
    ORA-06512: at "SYS.UTL_SMTP", line 21
    ORA-06512: at "SYS.UTL_SMTP", line 97
    ORA-06512: at "SYS.UTL_SMTP", line 139
    ORA-06512: at "SYS.UTL_MAIL", line 405
    ORA-06512: at "SYS.UTL_MAIL", line 594
    ORA-06512: at line 2
    We also tried connecting to the mail server through telnet .But it is not getting connected..
    Please help us to solve the issue.

    From your own posting you may have the clue, if you try to access your mail server through telnet and it is not successful, it means the service is down or there are networking issues.
    On pre 10gR2 versions there was a bug 4083461.8. It could affect you if you are on 10gR1
    "Bug 4083461 - UTL_SMTP.OPEN_CONNECTION in shared server fails with ORA-29278 Doc ID:      Note:4083461.8"
    This was fixed on 10gR2 base and on 9.2.0.8.0
    ~ Madrid

  • Idoc to txt file to mail

    Hello everyone,
    I have the following scenario:
    IDOC -> XI -> Mail w/ .txt attach with fields of IDOC separated by ';'
    How can i "concatenate" all fields into one text file and then send this in an attachment via email ?
                       Thank you in advance,

    Hi Nuno
    What you can do here is
    1. parse IDOC XML into a flat file using UDF or Java mapping and pass it to a string. use the mail package and map this string field to Content field of mail package. Now at mail adapter use Mail package with attachment.
    2. You write a mail adapter module to parse the file and attach it to mail.
    3. Use the StrictXMLtoPlain Bean at receiver mail adapter to parse IDOC XML into a flat file and then use MessageTransformBean to attach it to the mail
    Using Mail package usage will allow dynamic mail message.
    Thanks
    Gaurav

  • Issue with mail package - namespace

    Hi All
    I am trying to use mail package in my receiver mail adapter.
    The mandatory elements for using mail package are:
    <ns:Mail xmlns:ns="http://sap.com/xi/XI/Mail/30">
    <Subject>Hello</Subject>
    <From>sender email</From>
    <To>receiveremail</To>
    <Content>This is a mail</Content>
    </ns:Mail>
    How can i get the above specified namespace? How can i override my existing namespace with this new one?
    As i am using message mapping, I spicified message type's 'XML Namespace' field as "http://sap.com/xi/XI/Mail/30".
    But even this doesnt help.
    Thanks
    Chandra

    I am also trying to use the namespace.  All seems to be working but I do not get the e-mail message sent to me.  This what shows in my Technical routing payload.  (FYI had to replace the "at" sign with "-" for this posting due to the limits for the forum software.)
    <?xml version="1.0" encoding="utf-8" ?>
    - <ns:Mail xmlns:ns="http://sap.com/xi/XI/Mail/30">
      <subject>824 test</subject>
      <from>edi-na.modine.com</from>
      <to>s.m.posnanski-na.modine.com</to>
      <reply_to>edi_support-na.modine.com</reply_to>
      <content_Type>text/plain</content_Type>
      <content>Hello</content>
      </ns:Mail>
    I am usingXSL as an attachment and have the floowing defined in Module.
    Processing Sequence
    localejbs/AF_Modules/MessageTransformBean
       CHAN
    localejbs/sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean
    email
    Module Configuration.
    CHAN      Transform.ContentDisposition      attachment.filename="file.html"
    CHAN      Transform.ContentType      text/html;charset=utf-8
    This works fine when not using "Mail Package".  I want to use mail package to be able to have a dynamic subject line for the e-mail.
    Thanks.
    Scott

  • Mail package: missing end tag error

    Hi All
    I am using mail package for my receiver mail adapter.
    I have the required configuration for mail package as shown below:
    <ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30">
      <Subject>Test Subject</Subject>
      <From>From Sender</From>
      <To>To Sender</To> 
      <Content_Type>text</Content_Type>
      <Content>
      <Valid_Object>1000006-AAA-AAA</Valid_Object>
      <Company_Code>1001</Company_Code>
      </Content>
    </ns1:Mail>
    I get the following error in the communication channel monitoring:
    Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: com.sap.aii.messaging.util.XMLScanException: expecting end tag: Mail, but found {}Content at state 1
    How can i set this expected end tag?
    I thought </ns1:Mail> is the end tag and it is defined properly.
    Thanks
    Chandra

    Hello Sebin
    I have a proxy to mail scenario.
    I am extracting data from SAP and I have to send it in email as a text attachment.
    So, i am using mail package. My message type is as follows (as suggested by documentation):
    <ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30">
    <Subject>Test Subject</Subject>
    <From>Sender email</From>
    <To>Receiver email</To>
    <Content_Type>text</Content_Type>
    <Content>
    <Valid_Object>1000006-AAA-AAA</Valid_Object>
    <Company_Code>1001</Company_Code>
    </Content>
    <Content>
    <Valid_Object>1000006-BBB-BBB</Valid_Object>
    <Company_Code>1002</Company_Code>
    </Content>
    </ns1:Mail>
    I also checked 'keep attachments' option. I am not using adapter specific message attributes for mail adapter.
    Now, i am getting the following error in communication channel monitoring:
    Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException:
    com.sap.aii.messaging.util.XMLScanException: expecting end tag: Mail, but found {}Content at state 1
    I have a start tag "http://sap.com/xi/XI/Mail/30" as suggested by documentation.
    I thought, end tag can only be </ns1:Mail> which closes initially opened start tag with the same name.
    What is the mistake here? How can i get the end tag?
    Many Thanks
    Chandra

  • MAIL RECEIPT in Mail Package

    Hi,
    Iam using Mail package to send the mail .There is a structure MAILRECEIPT in mail package.How to get the response in the mail structure.
    Do we need to do some settings in Receiver mail adapter to obtain the Receipt ?
    Please help .
    Thanks and Regards,
    Rajesh Naidu

    Hi Rajesh,
    You dont need any extra settings in the Receiver mail adapter for this.
    You have to create Synchronous scenario here. So create a Synchronous Inbount Service Interface and select MAILRECEIPT of mail package for the Response Message Type. By doing this you will get the MAILRECEIPT as response.
    What do you have on the sender side?
    Regards,
    Aravind

  • Mail Package with XML attachment

    Hi Everybody,
    I am using Mail Package to implement dynamic mail.
    The email is sent successfully, the problem is that when I try to open my XML attachment and the error 'The page can not be displayed'  appears in my browser.
    I changed charset from ISO-8859-1 to UTF-8. But it still didn't work.
    Here is the information in my content_type tag:
    text/plain; charset=UTF-8 ; name=NFe.xml
    Please anyone could help me ?
    Regards,
    Daniela

    Thanks for your reply.
    In fact the right value for Context_Type tag is application/xml; charset="UTF-8"; name="MyFile.xml"
    And I also removed the values in the Tags "Content_Description" and "Content_Disposition".
    Now it is working fine.
    Regards,
    Daniela Machado

  • I want to drag files to mails but not in body of mail , more over the available type of attachments is only photo or video so how I can attach another type

    I want while replying incoming mails to drag files to mails but not in body of mail , more over the available type of attachments is only photo or video so how I can attach another type

    There is no dragging of anything in iOS.
    Attach as many files or emails as you'd like until it reaches the max capacity of attachements for the email provider.

  • Mail package

    hi
    The mail packages such as javax.mail,javax.mail.internet etc is present in the documentation of jdk1.4.0.but when i try to import these packages it is not identified.what shall i do

    It is part of J2EE (!= J2SE) but the JavaMail API is also available as a separate download.

  • Mail not appearing as HTML - Mail Adapter

    Hello All,
    I'm using the mail package in a receiver mail adapter. During mapping I format the content in HTML format, using &lt; &gt; form < and >. Also I set the content type of the mail package to text/html. However when the mail is received, the content of the mail is the html with tags, it does not appear as an html page. When I see the source the file still has the escape characters instead of < and >. But when I save this as an html file and open it, it appears as a web page.
    Any thoughts?
    Thanks,
    Sandeep

    HI,Specify whether you want to encode the content of the e-mail message. You have the following options:
    ·        None
    ·        base64 (default value)
    ·        quoted-printable
    use quoted-printable
    Coding of characters in e-mails that are not contained in the ASCII character set.
    The code contains German umlauts and special characters
    http://help.sap.com/saphelp_nw04/helpdata/en/6b/4493404f673028e10000000a1550b0/content.htm
    Regards
    Chilla
    Message was edited by:
            Chandra Sekhar Chilla

  • Why is mail erasing or resetting outgoing mail servers?

    Yesterday morning, Mail had reset itself to have no outgoing mail servers. I manually reentered the outgoing mail server info, and Mail functioned properly until this morning. Today, Mail had reset the outgoin mail server onmy several email accounts to None--but it didn't "erase" the proper email servers' info.  I've now manually changed the outgoing mail server for each of my email accounts, and Mail is functioning properly.  I'd like to understand what's happenin and how to prevent the nuissance int he future.  Thanks in advance for your help.

    Hi Bill, I take it the Mac loses that info when logged out or restarted?
    It sounds like your Main pref file is corrupted...
    /Users/YourUserName/Library/Preferences/com.apple.mail.plist
    Trouble is it holds almost everything, not sure if you'd like to quit Mail trash that file & setup Mail all over again, or if it'd be better to try trashing it once Mail is up & running & have it attempt to rebuild that file from what is in memory.
    Do you have any backups of that file?

Maybe you are looking for