XI Mail Adapter: sending emails with attachment with help of java mapping

Hi ,
On trying out the scenerio mentioned in the blog, using the java mapping provided
"XI Mail Adapter: An approach for sending emails with attachment with help of Java mapping
The scenerio works just fine.
But the payload as the content of the attachment is not getting generated in proper XML format.
I suppose it's because of the replace special characters code part..
Can anyone help me state the modification required in the code.
Thanks!
Regards,
Faria Mithani

It might be a codepage issue. Is your original payload UTF-8?

Similar Messages

  • Sender mail adapter - filter emails by attachment?

    Dear experts,
    I have a sender mail adapter that picks an XSL (EXCEL) attachment from an incoming email and converts it (with a custom adapter module) to XML.
    But now how can I make the adapter only process emails with XLS - attachments? In that Inbox I also have emails with HTML-attachments for example. And now my adapter also wants to process those messages.
    In my adapter module that makes XLS to XML I see an exception in RWB but the message still gets through to SXMB_MONI where it gets stuck with a red flag.
    Can I somehow tell the adapter to only process emails with XLS attachments?
    Or can I stop the processing in the adapter module that converts XLS to XML?
    Thank you for any input or ideas on this!
    Best regards,
    Peter
    PS: I am using this code to convert XLS to XML:
    http://wiki.sdn.sap.com/wiki/display/ABAP/AdapterModuleToReadExcelFilewithMultipleRowsandMultiple+Columns

    Hello ChizzT,
    Thank you for your idea. I went with this one and it worked.
    Best regards,
    Peter

  • XI Mail Adapter: Sending an XML attachment

    Hi
    I want to send an xml attachment using the XI Mail adapter. I have configured the adapter correctly and am currently receiving the email message.
    My issue is that my attachment has a .txt extention and I want it to have a .xml extn.
    I have seen a variety of web blogs around but none of these have helped.
    I have also changed my configuration from XIPAYLOAD to XIALL and still cannot get my payload message as a .xml attachment.
    When I config my adapter to use XIALL i get 2 attachments, a SOAP.xml and the my payload wiht the filename:
    [email protected]
    When I use XIPAYLOAD, with the keep attachment option ticked, I get an attachment with a .txt extn.
    I am convinced there must be a J2EE setting or maybe a ABAP config paramter that I need to update to get the .xml extn.
    Any help is greatly appreciated.
    Regards
    Yackeen

    Hi Yackeen,
    You can use localejbs/AF_Modules/MessageTransformBean
    You have to set the parameter :
    Transform.ContentDisposition as  
    attachment;filename=”myFileName.xml”>
    Best regards,
    Bela

  • Mail Adapter Send Mail with Attachment

    Hi all,
    I'm doing some tests on XI and implemented a little scenario, that send Mails.
    So this works fine, but I want to have the content as the content of the mail (no prob) and a attachment with a little more information for the user in a plain text file.
    I tried to code it with content-type multipart and all these stuff, but didn't come to a solution.
    Some one solved such a scenario already and can help?
    I also read some thread on SDN, but no solution. Perhaps its to simple
    Thanx
    regards
    Olli

    Oliver,
    We have found the solution for you.
    You should configure the mail adapter with 'use the mail adpater' and 'keep attachments'.
    Create an XML file conform the XML structure provide by SAP
    The mail package should look like this:
    <?xml version="1.0" encoding="utf-8"?>
    <ns:MT_Mail_Sent xmlns:xi="http://sap.com/xi/XI/Mail/30">
         <xi:Mail>
              <Subject>Item</Subject>
              <From>[email protected]</From>
              <To>[email protected]</To>
              <Content_Type><b>multipart/mixed; boundary="AaBb--984dfgeSSd3532"</b></Content_Type>
              <Content_Disposition>attachment</Content_Disposition>
              <Content>
    <b>AaBb984dfgeSSd3532</b>
    Content-Type: text/plain
    Hello, this is sample data.
    <b>AaBb984dfgeSSd3532</b>
    <b>Content-Type:</b> text/plain;name="CSV_data.csv"
    Order number;Item number;description<xsl:text>&#xD;&#xA;</xsl:text>
         <xsl:for-each select="Article_line">
         <xsl:value-of select="Ord_nmbr"/>;<xsl:value-of select="Item_nmbr"/>;<xsl:value-of select="Description<xsl:text>&#xD;&#xA;</xsl:text></xsl:for-each>
    <b>AaBb984dfgeSSd3532</b>
    <b>Content-Type:</b> text/plain;name="TXT_data.txt"
    Order number;Item number;description<xsl:text>&#xD;&#xA;</xsl:text>
         <xsl:for-each select="Article_line">
         <xsl:value-of select="Ord_nmbr"/>;<xsl:value-of select="Item_nmbr"/>;<xsl:value-of select="Description<xsl:text>&#xD;&#xA;</xsl:text></xsl:for-each>
    <b>AaBb984dfgeSSd3532</b>
              </Content>
         </xi:Mail>
    </ns:MT_Mail_Sent>
    In the above example you should have some content and 2 attachments (1 csv file and 1 txt file).
    After each break (AaBb984dfgeSSd3532) specify again the 'Content-Type'.
    Good luck
    Regards
    Ron

  • HT4864 I am using Direct Mail to send emails to the people in my organization, the problem is i don't know how to connect it with my iCloud account, does anyone know how?

    I am usind direct mail to send emails, problem is that when i put hthe STMP server and port number it does not log me in.
    does anyone know how?

    iCloud is a mail system, it neither needs nor will use someone elses email transport.

  • Send email from OWB with authenticated SMTP server (AUTH_LOGIN)

    Hi all,
    I want to send email from Oracle Warehouse Builder 11.2.0.2 using a SMTP server with basic authentication (AUTH_LOGIN).
    I've created an ACL for OWBSYS user according to note ID 1229769.1 in support.oracle.com.
    But, I need to configure again the ACL to connect to the SMTP server using user and password.
    I read the article in metalink, *How to Send an Email Using SMTP over an SSL Connection [ID 1323140.1]*+
    but I don't know how can I configure again the ACL for use in OWB.
    How OWB is able to authenticate with the SMTP server?
    Thanks!
    Maximiliano.

    Duplicate -
    How to send email from OSB with Mail server that requires SSL or STARTTLS
    Regards,
    Anuj

  • Sending email from Lr4 with Thunderbird

    Can anyone provide some help for  sending email from Lr4 with Thunderbird as the email program. When I select a photo and right-click Email Photo... I get the email photo dialog box with Mozilla Thunderbird in the From drop down. I click Send, and then I get an error message that says "There is no email program associated to perform the requested action. Please install an email program or, if one is already installed, create an association in the Default Programs control panel."
    Well, it seems as thigh Lr has Thunderbird in the From drop down, it knows an email program exists. Thunderbird is set as the default. I'm not sure what associations I am supposed to make (.eml and .wdseml are the default extensions, MAILTO is the default protocol, and Send mail is the default MAPI).
    Ay clues or hints?

    My default mail program is Thunderbird, and it works OK with Lightroom. If you are on a Windows 7 PC, go to Control Panel and check this out.
    Hope it helps.

  • When I my send email, its delivered with an unknown sender

    Problem with my email.  I got this email msg.
    "Mike,
    You sent your email with an unknown sender, so I was unable to reply to your email."
    when I my send email, its delivered with an unknown sender!
    This just started in the last couple days.

    Yes, 1st thing I did.   Looks normal.
    I sent an Test to my wifes PC.  Her Outlook shows my name, where my email address should show theirs only these : ( )
    I'm trying a couple test.....
    I've figure it out!!
    •  I have 3 email addresses. Two of them are thru my internet provider.  When I send thru that provider, the email is sent correctly, my email address shows as it should.
    •  When I send from my 3rd email address, which is provided thru my web site servicer, which is Go Daddy, my email address doesn't show! I'll be calling    Go Daddy!
    I just yesterday found out that their was a problem with my email. I couldn't figure out why this one guy told me my email address wasn't showing.  I spoke with another person this morning in her office, who told me the same thing - but was able to show me the email I sent her.
    I came home, my email all looked correct. Thats when I went to the Communities.
    I've got it figured out now. Thanks so much for trying to help.

  • I can't send emails on iPhone with my hotmail account. Is it not possible?

    I can't send emails on iPhone with my hotmail account. Is it not possible?

    I am having the same issue. It started this week. I have 2 email accounts on my phone. One is a hotmail. And the other one is a network solutions email. I can receive from both but not send. I've deleted the accounts and added them back on and nothing. I'm going crazy because one is my work email!

  • Sending email as attachment

    Hi ,
    Iam trying to code for sending email as attachement but iam not able to find y the mail is not getting attached and send to the receipent ..
    My file (MNR.pdf )is there in C:\Incometax folder
    I have coded like this : Everyhting is running fine but mail is not send
    data: itcpo like itcpo,
    tab_lines like sy-tabix.
    Variables for EMAIL functionality
    perform send_form_via_email.
    endform.                    " output_display
    FORM SEND_FORM_VIA_EMAIL *
    form send_form_via_email.
    Creation of the document to be sent File Name
    maildata-obj_name = 'C:\Incometax\MNR.pdf'.
    Mail Subject
    maildata-obj_descr = 'Subject'.
    Mail Contents
    mailtxt-line = 'Income tax'.
    append mailtxt.
    Prepare Packing List
    perform prepare_packing_list.
    Set recipient - email address here!!!
    mailrec-receiver = '[email protected]'.
    mailrec-rec_type = 'U'.
    append mailrec.
    Sending the document
    call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    exporting
    document_data = maildata
    put_in_outbox = ' '
    tables
    packing_list = mailpack
    object_header = mailhead
    contents_bin = mailbin
    contents_txt = mailtxt
    receivers = mailrec
    exceptions
    too_many_receivers = 1
    document_not_sent = 2
    operation_no_authorization = 4
    others = 99.
    if sy-subrc eq 0 .
    write :/ 'mail send '.
    endif .
    endform.
    Form PREPARE_PACKING_LIST
    form prepare_packing_list.
    clear: mailpack, mailbin, mailhead.
    refresh: mailpack, mailbin, mailhead.
    describe table mailtxt lines tab_lines.
    read table mailtxt index tab_lines.
    maildata-doc_size = ( tab_lines - 1 ) * 255 + strlen( mailtxt ).
    Creation of the entry for the compressed document
    clear mailpack-transf_bin.
    mailpack-head_start = 1.
    mailpack-head_num = 0.
    mailpack-body_start = 1.
    mailpack-body_num = tab_lines.
    mailpack-doc_type = 'BCS'.
    append mailpack.
    mailhead = 'C:\Incometax\MNR.pdf'.
    append mailhead.
    File 1
    mailbin = 'This is file 1'.
    append mailbin.
    describe table mailbin lines tab_lines.
    mailpack-transf_bin = 'X'.
    mailpack-head_start = 1.
    mailpack-head_num = 1.
    mailpack-body_start = 1.
    mailpack-body_num = tab_lines.
    mailpack-doc_type = 'BCS'.
    mailpack-obj_name = 'C:\Incometax\MNR.pdf'.
    mailpack-obj_descr = 'Subject'.
    mailpack-doc_size = tab_lines * 255.
    append mailpack.
    *File 2
    mailbin = 'This is file 2'.
    append mailbin.
    data: start type i.
    data: end type i.
    start = tab_lines + 1.
    describe table mailbin lines end.
    mailpack-transf_bin = 'X'.
    mailpack-head_start = 1.
    mailpack-head_num = 1.
    mailpack-body_start = start.
    mailpack-body_num = end.
    mailpack-doc_type = 'BCS'.
    mailpack-obj_name = 'C:\Incometax\MNR.pdf'.
    mailpack-obj_descr = 'Subject'.
    mailpack-doc_size = tab_lines * 255.
    append mailpack.
    endform.

    Hi,
    pls chk this sample code.
    report zXYZ_0003.
    data: itcpo like itcpo,
          tab_lines like sy-tabix.
    * Variables for EMAIL functionality
    data: maildata   like sodocchgi1.
    data: mailpack   like sopcklsti1 occurs 2 with header line.
    data: mailhead   like solisti1 occurs 1 with header line.
    data: mailbin    like solisti1 occurs 10 with header line.
    data: mailtxt    like solisti1 occurs 10 with header line.
    data: mailrec    like somlrec90 occurs 0  with header line.
    data: solisti1   like solisti1 occurs 0 with header line.
    perform send_form_via_email.
    *       FORM  SEND_FORM_VIA_EMAIL                                      *
    form  send_form_via_email.
      clear:    maildata, mailtxt, mailbin, mailpack, mailhead, mailrec.
      refresh:  mailtxt, mailbin, mailpack, mailhead, mailrec.
    * Creation of the document to be sent File Name
      maildata-obj_name = 'TEST'.
    * Mail Subject
      maildata-obj_descr = 'Subject'.
    * Mail Contents
      mailtxt-line = 'Here is your file'.
      append mailtxt.
    * Prepare Packing List
      perform prepare_packing_list.
    * Set recipient - email address here!!!
      mailrec-receiver = '[email protected]'.
      mailrec-rec_type  = 'U'.
      append mailrec.
    * Sending the document
      call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
           exporting
                document_data              = maildata
                put_in_outbox              = ' '
           tables
                packing_list               = mailpack
                object_header              = mailhead
                contents_bin               = mailbin
                contents_txt               = mailtxt
                receivers                  = mailrec
           exceptions
                too_many_receivers         = 1
                document_not_sent          = 2
                operation_no_authorization = 4
                others                     = 99.
    endform.
    *      Form  PREPARE_PACKING_LIST
    form prepare_packing_list.
      clear:    mailpack, mailbin, mailhead.
      refresh:  mailpack, mailbin, mailhead.
      describe table mailtxt lines tab_lines.
      read table mailtxt index tab_lines.
      maildata-doc_size = ( tab_lines - 1 ) * 255 + strlen( mailtxt ).
    * Creation of the entry for the compressed document
      clear mailpack-transf_bin.
      mailpack-head_start = 1.
      mailpack-head_num = 0.
      mailpack-body_start = 1.
      mailpack-body_num = tab_lines.
      mailpack-doc_type = 'RAW'.
      append mailpack.
      mailhead = 'TEST.TXT'.
      append mailhead.
    * File 1
      mailbin = 'This is file 1'.
      append mailbin.
      describe table mailbin lines tab_lines.
      mailpack-transf_bin = 'X'.
      mailpack-head_start = 1.
      mailpack-head_num = 1.
      mailpack-body_start = 1.
      mailpack-body_num = tab_lines.
      mailpack-doc_type = 'TXT'.
      mailpack-obj_name = 'TEST1'.
      mailpack-obj_descr = 'Subject'.
      mailpack-doc_size = tab_lines * 255.
      append mailpack.
    endform.
    Regards,
    Anver
    <b><i>if hlped pls mark points</i></b>

  • Mail Adapter Sender error

    Hi,
    I need to use Mail Adapter Sender with MAPI protocol.
    I have create my Comunication Channel of type IMAP4 and configured URL as mapi://server and actved one.
    In RWB appears the message "mail client job stopped completly"
    Can anybody help me?

    The URL must be: imap://server/inbox
    This is hard coded in the mail adapter and cannot be changed.
    Only imap4 and pop3 are supported.
    Regards
    Stefan

  • Mac mail keeps sending emails from different accounts even though it says correct email in "sent" folder. Recipients reply and it goes to different email address. So confusing.

    mac mail keeps sending emails from my different accounts even though it says correct email in "sent" folder and correct email account was highlighted. Recipients reply and it goes to different email address. So confusing and annoying.

    Hi Mike,
    I had the same issue and managed to solve it.
    Go into Mail>Preferences>Accounts
    Then in the account information tab, at the bottom should be outgoing mail server (SMTP) and click the drop down box
    Mine had a few different servers in it so i went into edit SMPT server list. Click advanced and it will tell you which ones are going from which email address.
    Delete the ones you dont want, and it should work or instead of deleting click use only this server, i imagine that will work to
    Hope This Helps
    George

  • I can't gey yahoo mail to send email- it says something like not connected to server?

    I Cannot get yahoo mail to send emails. I wonder what step I missed during the sort up process?

    Howdy msmantila,
    It sounds like you cannot check your Yahoo email on the iPad. I would recommend the troubleshooting in the following article to help get that resolved, named:
    iOS: Troubleshooting Mail
    http://support.apple.com/kb/ts3899
    Tap Safari and load a webpage. If you can load a webpage, then your device has Internet access. If you can't load a webpage, check your Wi-Fi connection or try a different Internet connection:
    Try a different Wi-Fi connection.
    If your iOS device has an active cellular data plan, tap Settings > Wi-Fi and turn off Wi-Fi.
    If the affected email account is provided by your Internet provider, see if your issue is resolved while connected to your home Wi-Fi network.*
    Log in to your email provider's website to make sure that the account is active and the password is correct.
    Make sure your settings are correct using Mail Settings Lookup.
    Restart your iOS device.
    Delete the affected email account from your device.
    Tap Settings > Mail, Contacts, Calendars.
    Tap the affected email account.
    Tap Delete Account.
    Add your account again.
    Thank you for using Apple Support Communities.
    Cheers,
    Sterling

  • How to use java mail to send email to hotmail box

    how to use java mail to send email to hotmail box??
    i can send emails to other box(my company's email account) but for hotmail, the program didnt print any err or exception the recepient cant receive the mail.
    thanks

    you ust to download activation.jar and mail.jar and add them to your build path.
    i have used the googlemail smtp server to send mail the code is following:
    public void SendMail()
    Properties props = new Properties();
    props.put("mail.smtp.user", username);
    props.put("mail.smtp.host", host);
    props.put("mail.smtp.port", port);
    props.put("mail.smtp.starttls.enable","true");
    props.put("mail.smtp.auth", "true");
    props.put("mail.smtp.socketFactory.port", port);
    try{
         Authenticator auth = new SMTPAuthenticator(username,password);
    Session session = Session.getInstance(props, auth);
    MimeMessage msg = new MimeMessage(session);
    msg.setText(text);
    msg.setSubject(subject);
    msg.setFrom(new InternetAddress(senderEmail));
    msg.addRecipient(Message.RecipientType.TO, new InternetAddress(receiver));
    Transport.send(msg);
    }catch(Exception ex) {
         System.out.println("Error Sending:");
    System.out.println(ex.getMessage().toString());
    and this the SMTPAuthenticator Class which you will need too.
    class SMTPAuthenticator extends javax.mail.Authenticator {
         private String fUser;
         private String fPassword;
         public SMTPAuthenticator(String user, String password) {
         fUser = user;
         fPassword = password;
         public PasswordAuthentication getPasswordAuthentication() {
         return new PasswordAuthentication(fUser, fPassword);
         }

  • I can receive emails but can't send emails. Can someone help me?  Thank you.

    I can receive emails but can't send emails. Can someone help me?  Thank you.

    iOS: Unable to send or receive email
    http://support.apple.com/kb/TS3899
    Can’t Send Emails on iPad – Troubleshooting Steps
    http://ipadhelp.com/ipad-help/ipad-cant-send-emails-troubleshooting-steps/
    Setting up and troubleshooting Mail
    http://www.apple.com/support/ipad/assistant/mail/
    Using a POP account with multiple devices
    http://support.apple.com/kb/ht3228
    iOS: Adding an email account
    http://support.apple.com/kb/HT4810
    iOS: Setting up an Outlook.com, Hotmail, Live, or MSN email account
    http://support.apple.com/kb/ht1694
    iPhone, iPad, iPod touch: Microsoft Outlook 2003, Outlook 2007, Outlook 2010 may not display contacts and calendars after sync
    http://support.apple.com/kb/TS1944
    Server does not allow relaying email error, fix
    http://appletoolbox.com/2012/01/server-does-not-allow-relaying-email-error-fix/
    Why Does My iPad Say "Cannot Connect to Server"?
    http://www.ehow.co.uk/info_8693415_ipad-say-cannot-connect-server.html
    How to Delete Email on the iPad
    http://ipad.about.com/od/iPad_Guide/ss/How-To-Delete-Email-On-The-Ipad.htm
    How to Mass Delete Emails from iPhone and iPad Inbox (with video)
    http://suiteminute.com/how-to-mass-delete-emails-from-iphone-and-ipad-inbox/
    How to add, send and open iPad email attachments
    http://www.iskysoft.com/apple-ipad/ipad-email-attachments.html
    How to Sync Contacts with Your iPad Using iTunes
    http://www.dummies.com/how-to/content/how-to-sync-contacts-with-your-ipad-using- itunes.html
    iOS: 'Mailbox Locked', account is in use on another device, or prompt to re-enter POP3 password
    http://support.apple.com/kb/ts2621
    iCloud: Create a group and add contacts to it
    http://support.apple.com/kb/PH2667
    eMail Groups - You can use a third party app that many users recommend.
    MailShot -  https://itunes.apple.com/us/app/mailshot-pro-group-email-done/id445996226?mt=8
    Group Email  -  https://itunes.apple.com/us/app/mailshot-pro-group-email-done/id445996226?mt=8
    iPad Mail
    http://www.apple.com/support/ipad/mail/
    Configuration problems with IMAP e-mail on iOS with a non-standard SSL port.
    http://colinrobbins.me/2013/02/09/configuration-problems-with-imap-e-mail-on-ios -with-a-non-standard-ssl-port/
    Try this first - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.)
    Or this - Delete the account in Mail and then set it up again. Settings->Mail, Contacts, Calendars -> Accounts   Tap on the Account, then on the red button that says Remove Account.
     Cheers, Tom

Maybe you are looking for

  • External drive not showing in event library

    I was creating a video, where some of the clips were on the iMac harddrive and some of them were on an external SeaGate harddrive.  I was waiting for an optical flow rendering of one of the clips and walked away from the computer.  Unfortunately, the

  • Why is the grid not lining up properly?

    relevant code:      private static final int SCREEN_WIDTH = 640;      private static final int SCREEN_HEIGHT = 640;      private final int[][] a;      private final int width;      private final int height;      private final int boxSizeX;      priva

  • Filter creation program for pc?

    Hello, im looking for a photoshop filter making program for the pc. Ive seen a few But seem to be strickly for mac. I have a art style that I want to make into a filter, if there is no program does anybody know how I can make one in photoshop cs4? an

  • HT1918 I need to change my rescue email

    I nedd to change my rescue email

  • ITunes not properly alphabetizing "the" artists

    Pretty self-explanatory, but let me clarify. Basically, there are certain albums by The Mountain Goats that get alphabetized under "T" (for the) instead of "M" like the rest of The Mountain Goats titles. I have checked to make sure the artist AND alb