Change e-mail body in mail adapter using module.

Hi All,
I am woking with one mail adapter and I prepared one code to change the attachement name and body content. The attachement is working good but the body e-mail is not working.
After to check a lot of blog my code now is creating two attachements one with the Payload (xml) and other with the text that suppose to come as a body e-mail.
Someone could help me ?
Thanks a lot.
Michael Peretto

Hi Michael,
Can you check if your main attachment (the one that should be the mail text) does not carry the wrong content-disposition header?
The easiest way to check is to use some message capturing tool (e.g., TCPGateway attached in the SOAP FAQ Note). If this header is present, it should have value inline to inform the mail client to display the content in inline. If the value is set wrong, the MessageTransformBean module can be misused to repair this content header.
Best regards, Yza

Similar Messages

  • Mail Body Formatting - Mail Receiver Adapter

    Hello,
    I use the Mail Receiver Adapter (SMTP) with and use Mail Package to set Attributes during Mapping.
    My Question: Is there any possibility to format the body of the Email Message (e.g. line feeds) when mapping the field "Content" of the target structure?

    If you use the graphical mapping tool, then you can use a user defined function for this issue. In this function you add the line feeds.
    Regards
    Stefan

  • Decoding in Adapter using Module

    Hi,
    Following is the scenario overview:
    1. Source file is encoded text file.
    2. Decode the source file to obtain the XML file using Base64 decoder in adapter Module.
    3. Use the XML file for mapping.
    I have written a java code which decodes the file and forms the XML.When i run it as a stand alone it works fine.
    When I deploy it, it does not decode the whole source text and forms partial xml file because of which whole scenario does not work.
    Can anyone suggest where and what the problem can be?

    Hi Manjusha,
    Thanks for the reply..
    The issue is resolved now.. but there is another issue that has come up..
    The problem now is that the module works with File adapter i.e. end to end is successful.
    But the same module gives error with JMS adapter.
    Its strange..
    Edited by: P M on Jul 31, 2009 11:57 AM
    Edited by: P M on Jul 31, 2009 12:34 PM

  • Async/Sync Bridge in JMS Adapter using modules

    Hi All,
    can you please help me on this, I have done a JMS to SOAP scenario where I have used two JMS comm channels.
    one is for sender JMS system and another is for getting the response message back.
    can any one please tell me should I maintain a receiver agreement with the comm channel thru which I am getting the response message back to the JMS system?
    and can I maintain the same connection parameters in both of this  JMS comm channels?
    Thanks
    Vineet

    Hi,
    The same connection parameters can be used across the two Jms channels. And you have to define two receiver agreements, one of Receiver Soap and the other for Receiver Jms.
    I am not completely sure whether it works, even with no receiver agreement at Jms receiver side.
    Regards,
    Swetha.

  • Issue with embading image in mail body

    hi all,
    I want to embade an image in the mail body which im sending using sap.
    I have also tried to search on forum and I got some help which suggested me to use used html coding, I have tried it but the mail is
    thanks

    Hi.,
    First you have to store image in MIME Repository. , then use HTM  type to send mail .,
    check these : [Send Picture in body of Email|Send an picture to body of an email;
    and  [Send HTML mail with image|Re: Send HTML mail with image;
    hope this helps u.,
    Thanks & regards,
    Kiran

  • Formating the mail body

    Hi to all
    Is it possible to format the mail body that we create using FM 'SO_NEW_DOCUMENT_ATT_SEND_API1' like a rich user interface?
    Kindly suggest.
    Thanks & Regards
    Vipin

    Its possible to give html tags in the body internal table thereby make it a rich user interface. For html you may need to use document type as HTM.
    I 've given an example in this link. Please have a look.
    Re: Bold, Colors in mail - Urgent
    Rgds,
    TM.

  • Mail Adapter Use Mail Package, Mail Body and Attachment

    Hello
    Have some body a idea, how I can configure the mail adapter with use mail package, that I have in the mail a attachment with content from the messages and a mail body with also text from the message.
    Thanks for your reply.
    Regards Tom
    The different Weblog , I have check:
    /people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
    https://www.sdn.sap.com/sdn/weblogs.sdn?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [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

    Hi Thomas,
    If you are configuring your Mail adapter as reciever then refer
    http://help.sap.com/saphelp_nw04/helpdata/en/6b/4493404f673028e10000000a1550b0/content.htm
    your sender (say file) should have some message like this
    <i>
    <ml:Mail xmlns:ml=’http://sap.com/xi/XI/Mail/30’>
       <Subject>Important</Subject>
       <From>[email protected]</From>
       <To>[email protected]</To>
       <X_Mailer>Outlook Express </X_Mailer>
       <Content>
       This is the content.
       </Content>
    </ml:Mail></i>
    And for Sender Mail Adpater
    http://help.sap.com/saphelp_nw04/helpdata/en/23/c093409c663228e10000000a1550b0/content.htm
    Hope this will be helpful
    Regards
    Suraj

  • Mail : Mail Payload doesn't changes to inline (body) still become attachmen

    Hi,
    I have scenario ABAP Proxy (Main Payload + attachment) ---> Mail (XIPAYLOAD + Mail Package + keep attachment).
    =========================== ABAP PROXY OUT ASYN ===========================
        attachment_protocol ?= prxy->get_protocol(
        if_wsprotocol=>attachments ).
        attachment = attachment_protocol->get_attachment_from_binary(
               data = attach_xstring
               type = if_ai_attachment=>c_mimetype_text_plain
               name = 'Outmail' ).
        APPEND attachment TO attachments.
        attachment_protocol->set_attachments( attachments ).
        it-mt_source_proxy-to = 'XXXXXXX'.
        it-mt_source_proxy-subject = 'Test email with attachment'.
        it-mt_source_proxy-content = 'ccccccccccccccccccccccccccccc'.
        CALL METHOD prxy->execute_asynchronous
          EXPORTING
            output = it.
        COMMIT WORK.
    =========================================================================
    So the result is both payload become attachment. Now the problem is how to change the main payload to become body of email and still keep the attachment become mail attachment.
    I have configure PayloadSwapBean and MessageTransformBean in mail adapter receiver as below :
    1. localejbs/AF_Modules/PayloadSwapBean             swap1
    2. localejbs/AF_Modules/MessageTransformBean      type2
    3. localejbs/AF_Modules/PayloadSwapBean             swap2
    4. localejbs/AF_Modules/MessageTransformBean      type1
    swap1   swap.keyName                                  payload-name
    swap1   swap.keyValue                                  Outmail
    type2    Transform.ContentDescription             Outmail
    type2    Transform.ContentDisposition             attachment;filename="abc.txt"
    swap2   swap.keyName                                 payload-name
    swap2   swap.keyValue                                 MainDocument
    type1    Transform.ContentDescription            MainDocument
    type1    Transform.ContentDisposition            inline
    But then the main document content still in attachment cannot change to body eventhough i have put inline in Transform.ContentDisposition.
    Please advise, what i am missing in this configuration.
    Thank you and Best Regards
    Fernand

    For all, who searches a way for this scenario:
    you could write a java mapping and use it after the last other mapping in operation mapping. Use this coding for it:
    import com.sap.aii.mapping.api.*;
    import java.util.*;
    import java.io.*;
    public class MappingPayloadAttachment extends AbstractTransformation{
        public void transform(TransformationInput input, TransformationOutput output)
           throws StreamTransformationException {
            getTrace().addInfo("JAVA Mapping Called: MappingPayloadAttachment");
            try{
                InputPayload inpayload = input.getInputPayload();
                InputStream instream = inpayload.getInputStream();
                String instring = this.convertStreamToString(instream);
                InputAttachments inAttachments = input.getInputAttachments();
                OutputPayload outpayload = output.getOutputPayload();
                OutputStream outstream = outpayload.getOutputStream();
                OutputAttachments outAttachments = output.getOutputAttachments();
                //create Output-Payload
                outstream.write(instring.getBytes());
                //copy attachments
                if(inAttachments.areAttachmentsAvailable()){
                    Collection<String> colAttIds = inAttachments.getAllContentIds(true);
                    Iterator<String> attIDsIt = colAttIds.iterator();
                    while(attIDsIt.hasNext()){
                        outAttachments.setAttachment(inAttachments.getAttachment(attIDsIt.next()));
                }else{
                    getTrace().addInfo("MappingPayloadAttachment Information: no attachment available.\n");
            }catch(Exception e){
                StreamTransformationException ste = new StreamTransformationException(e.toString());
                throw ste;
        public String convertStreamToString(InputStream in){
            StringBuffer sb = new StringBuffer();
            try
                InputStreamReader isr = new InputStreamReader(in);
                Reader reader = new BufferedReader(isr);
                int ch;
                while((ch = in.read()) > -1) {
                    sb.append((char)ch);}
                    reader.close();
                }catch(Exception exception) { }
                return sb.toString();
    And don't forget to check the cross for "Read Attachments" in Operation Mapping configuration. Now you should be able to config the payload as mail body (inline).
    Regards,
    Dirk

  • How to pass text message as a body in mail adapter

    Hi ,
    I configued mail adapter and I am receiving the message as xml attachments.But I need to get message in body as text formate not an xml message.
    for exaple I am getting the message like this as attachment
      <?xml version="1.0" encoding="UTF-8" ?>
    <ns0:MT_MAIL xmlns:ns0="http://it.com/FI/I001">
    -<MAIL>
    <A>
      <FILE>PLEASE KEEP THE FILE</FILE>
      </A>
    <B>
    <FILE>PLEASE KEEP FILE</FILE>
      </B>
      </MAIL>
      </ns0:MT_MAIL>
    I required message in MAIL BODY ( NO attachment) like below
    A PLEASE KEEP THE FILE
    B PLEASE KEEP THE FILE
    LIKE THAT  I NEED MY OUTPUT IN MAIL BODY ...
    PLEASE GUID HOW TO PROCEED ....

    PayloadSwap Bean to read contents of the attachment: /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
    XIPAYLOAD is protocol to be used in the mail channel...many blogs available for how to send mail as body.
    Regards,
    Abhishek.

  • Change font in e-mail body

    Hi All,
    I need to know whether it is possible to use multiple font styles in the body of an e-mail sent through a report program.
    I am using the FM 'SO_DOCUMENT_REPOSITORY_MANAGER' as I want to send a document from the desktop as an e-mail attachment.
    The FM 'SO_DOCUMENT_SEND_API1' does not serve the primary purpose of my requirement. So, it is eliminated.
    Please suggest any method to achieve the requirement of using multiple font styles in e-mail body.
    Thanks,
    Dawood

    If you set the document to be a HTML type, then you can use HTML scripting to set
    the font.
    Create send request
       send_request = cl_bcs=>create_persistent( ).
    Create html content:
        mail_line = '.mail TBODY,{font-family:verdana;font-size:10pt;}'.
        append mail_line TO mail_text.
        ... (your text)
    Create document with type 'HTM' and provide your HTML scripting
          document = cl_document_bcs=>create_document( i_type    = 'HTM'
                                                       i_text    = mail_text
                                                       i_subject = 'Subject' ).
    Add document to send request
          CALL METHOD send_request->set_document( document ).
    Send document
          CALL METHOD send_request->send( ).

  • How to send the body of mail in html format using servlet

    Hi
    i developed an servlet using sun.net.smtp.SmtpClient package,my servlet receiving data from an form,i can able to send mail successfully,but my mail body part is in the text format,but i would like to send it as an html format,for ex <input type="text" size="25" name="Name"> as an input field with value received from the form instead of showing tags as i mentioned<input type="text" size="25" name="Name"> ,any help would be appreciated.
    Regards.

    See this program
    But here whats the problem is ,
    some maiservers doesnot support html code if u send this mail to yahoo account it will show html code as it is,
    hotmail account encodes the html and shows proper fonts and headings
    import java.io.*;
    import java.util.*;
    import java.net.*;
    import sun.net.smtp.SmtpClient;
    public class SendMail {
              public static void main(String args[]){
              int i = 0;
              //while (true) {
              SmtpClient mail;
              try{
                   i++;
                   String email = "[email protected]";
                   String from="[email protected]";
                   mail=new SmtpClient("bizpivot.com");
                   mail.from(from);
              mail.to(email);
                   PrintStream msg=mail.startMessage();
                   msg.println("To: " +email);
                   msg.println("Subject: Hai" i "!!!");
                   msg.println("<html><head><title>Untitled</title></head><body bgcolor='red' text='#00ffff'><font face='Courier New' size='+3'>Hai How are you Man!!!</font></body></html>");
                   mail.closeServer();
              System.out.println(i);
              catch(Exception e){e.printStackTrace();}

  • How to send mail body using RE_CN_RA_INVOICE interface from RECPA520

    Hi ABAP Guru,
    I am using a standard interface RE_CN_RA_INVOICE for tcode RECPA520 for generating pdf form and send the corresponding PDF to  corresponding address maintained in Business Partner.The problem is mail is sending with attachment but there is no mail body.
    Please help

    You have to convert your long string to a table of shorter strings.
    There may be other ways, but one possibility is to use a loop to process you string.
    while (there is something left)
       put the next e.g. 1024 characters in a new row of your table
    endwhile
    If you need to reconstruct your string from the table, don't use simple concatenation since it will remove blanks at the end of lines. Believe me (from experience) sooner or later this will happen.
    Instead you need to either set the subsections of your long string, or insert from the end of your table and keep shifting the contents (probably less efficient) right

  • Hw to write txt in mail body using UTL mail when sending mail with attachme

    hi all
    i m using oracle demo mail package to send csv file as attachment to different users its successfull and i can also able to attach text file to it
    but i m unable to write any text in mail body .
    e.g.
    mail body can be--
    hi
    This is test mail.
    Regds
    Sender.
    can anyone suggest some way?

    u can try this code
    this code takes the file from database and attach with mail and also send the body with it
    it works fine.
    CREATE OR REPLACE
    procedure pdf_mail(
    p_sender varchar2, -- sender, example: 'Me '
    p_recipients varchar2, -- recipients, example: 'Someone '
    p_subject varchar2, -- subject
    p_text long, -- text
    p_case_id number,
    p_email_log_id number
    -- p_filename varchar2, -- name of pdf file
    p_blob   blob     pdf file
    ) is
    conn utl_smtp.connection;
    i number;
    len number;
    p_message_part varchar2(32767);
    cursor c1 is
    select file_name,document_pic
    from clm_case_attachments ca,email_log_detail em
    where
    case_id = p_case_id
    and ca.CASE_ATTACHMENT_ID = em.ATTACHMENT_ID
    and em.ACTIVE = 'Y'
    and em.EMAIL_LOG_ID = p_email_log_id;
    BEGIN
    conn := demo_mail.begin_mail(
    sender => p_sender,
    recipients => p_recipients,
    subject => p_subject,
    mime_type => demo_mail.MULTIPART_MIME_TYPE);
    demo_mail.attach_text(
    conn => conn,
    data => p_text,
    mime_type => 'text/html');
    for lp in c1 loop
    demo_mail.begin_attachment(
    conn => conn,
    mime_type => 'application/pdf',
    inline => TRUE,
    filename => lp.file_name,
    transfer_enc => 'base64');
    -- split the Base64 encoded attachment into multiple lines
    i := 1;
    len := DBMS_LOB.getLength(lp.document_pic);
    WHILE (i < len) LOOP
    IF(i + demo_mail.MAX_BASE64_LINE_WIDTH < len)THEN
    UTL_SMTP.Write_Raw_Data (conn
    , UTL_ENCODE.Base64_Encode(
    DBMS_LOB.Substr(lp.document_pic, demo_mail.MAX_BASE64_LINE_WIDTH, i)));
    ELSE
    UTL_SMTP.Write_Raw_Data (conn
    , UTL_ENCODE.Base64_Encode(
    DBMS_LOB.Substr(lp.document_pic, (len - i)+1, i)));
    END IF;
    UTL_SMTP.Write_Data(conn, UTL_TCP.CRLF);
    i := i + demo_mail.MAX_BASE64_LINE_WIDTH;
    END LOOP;
    demo_mail.end_attachment(conn => conn);
    end loop;
    demo_mail.end_mail( conn => conn );
    END;
    /

  • Mail Adapter using ZIP files

    Hi,
    I need to create a bidirectional integration based in mail. These mails have an attached zipped file that contains 8-10 xml files and those files are the files I must use to create integration.
          1 - Any Idea to receive zipped files?
          2 - How can I deal with all the received files?
          3 - How can I generate and pack the files to send to the external system?
    Best regards,
    Alfredo Lagunar.

    Hi
    Reffer to below mentione dlinks they may help you .
    Please go throgh these links
    http://help.sap.com/saphelp_nw04/helpdata/en/6b/4493404f673028e10000000a1550b0/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9e6c7911-0d01-0010-1aa3-8e1bb1551f05
    Receiver Mail Adapter.
    /people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
    eMail Reporting
    eMail Report as Attachment (Excel/Word)
    The specified item was not found.
    The specified item was not found.
    The specified item was not found.
    Regard's
    Chetan Ahuja

  • How to increase TD width in SAP using HTML code in mail body

    Dear guru.
    how to increase TD width in SAP using HTML code in mail body
    Sample Code :
    CONCATENATE '<tr height= "3%"> <td style="background-color:#CCC8AA;" style="font = 12.0" colspan = 3 >' WA_EIS_TOT-DESC '</td>'
           INTO WA_OBJTXT-LINE separated by space.
      APPEND WA_OBJTXT TO T_OBJTXT.
      CLEAR: WA_OBJTXT.
    Regards,
    Dharmin Shah

    Hi Dharmin,
    Did you try something like
    CONCATENATE '<tr height= "3%"> <td  height="23" width="84" style="background-color:#CCC8AA;" style="font = 12.0" colspan = 3 >' WA_EIS_TOT-DESC '</td>'
    Regards,
    Soundarya.

Maybe you are looking for

  • How do I Move Music from iPod Nano(2nd Gen) to Computer with Windows Vista?

    I just got a new computer due to my old computer crashing so I'd like to transfer my music from my iPod Nano 2nd Generation to my new computer so I'll have a backup. I followed the directions listed below but they didn't work. Is it possible that it

  • Need help in order to buy Toshiba notebook from Toshiba directly

    Good morning. I want to buy a laptop in http://www.toshibadirect.com/ and chose the product, I have credit card. I have a family who will receive the laptop What I want is someone advise me on the east or purchase I need help to complete the purchase

  • What are Sys Prefs for View desktop on TV monitor

    I have the cable connected to the computer and a flat screed TV. i get the startup display on the monitor, the mouse tracks and the screen saver works but the screen saver pictures are not the same. I cannot get the computer desktop on the TV monitor

  • Adobe Acrobat 7 Security Bulletin

    http://www.adobe.com/support/security/bulletins/apsb06-20.html Critical vulnerabilities have been identified in Adobe Reader and Acrobat 7.0 through 7.0.8 that could although Adobe is not aware of any specific code exploits at this time allow an atta

  • Unable to connect to the Livecycle Server in CM (Non Turnkey Install)

    As per the guide, I performed the following steps in the non turnkey install of LiveCycle 1) Installed the JDK 1.5.0_11 2) Copied the Jboss 4.0.3 folder from the install folder to C:\jboss 3) Created the datasource and JMS for Oracle 4) Installed the