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

Similar Messages

  • HT1386 my iPod is disabled! says to connect to iTunes..... i do that and it doesn't change the screen! still says disabled connect to iTunes!  help1

    my ipod touch is disabled and it say to connect to iTunes.... I  connected to itunes and it doesnt change my ipod screen! help me get back into my ipod touch again!

    You will have to erase the iPod,
    Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
    iOS: Wrong passcode results in red disabled screen                         
    If recovery mode does not work try DFU mode.                        
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings        
    For how to restore:
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: Back up and restore your iOS device with iCloud or iTunes
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload most iTunes purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store        
    If problem what happens or does not happen and when in the instructions? When you successfully get the iPod in recovery mode and connect to computer iTunes should say it found an iPod in recovery mode.

  • Why the html file doesn't change with applet ?

    i am new to java , i get a problem when i am modifying a applet . i recompile it to .class file but did not change its name . and the .html file which use the applet doesn't change with it , it still shows the original style , even when i delete the .class file . it works until i changed the name of the source file and use the different .class file in html . it's troublesome if i need to modify the source file because i must change the name to get it . can you tell me why and how could i avoid this ?

    I am new also & had a similar experience.
    In my case it was aftercompiling and trying to refresh the browser to get it to display the new version of my applet. I got around this by holding Ctrl down and pressing F5 to refresh.
    Also, some of the systems at university cause exactly the problem you describe. Not sure why it should work but we overcame it by placing our files in the JDK folder on those systems & it worked properly. May be worth a try.

  • My "sent mail " tone doesn't work. All other tones do work.   I've changed tones and rebooted. Still silent

    "sent mail" tone doesn't work. All other tones do. What to do?
    ILive changed tones and rebooted

    Hi Gwing17,
    Welcome to the Apple Support Communities!
    I understand that all of your iPhone sounds are working as expected except for the Sent Mail sound. I understand that you have already changed the Sent Mail sound as well as reset your iPhone and the issue persists. In this situation, to isolate the issue, I would first recommend backing up your iPhone to either iTunes or iCloud.
    Back up and restore your iPhone, iPad, or iPod touch using iCloud or iTunes - Apple Support
    After you have backed up, I would recommend restoring your iPhone and setting it up as new to test the Sent Mail sound. If the sound works as expected, try restoring from your backup and test the sound again. Please let me know if the issue returns or if the sound still does not work when you set up your iPhone as a new device.
    Use iTunes to restore your iOS device to factory settings - Apple Support
    Cheers,
    Joe

  • Mac Mail Issue: I was having trouble sending to hotmail accounts from my Earthlink account, they had me go into Mac Mail preferences and make changes, now Mac Mail doesn't work AT ALL - any help changing the settings back to correct Mac Mail settings? I c

    I was having trouble sending to hotmail accounts from my Earthlink account, they had me go into Mac Mail preferences and make changes (because they claimed it was Mac Mail's fault, even though the hotmail error code said it's because Earthlink is blocked by hotmail), now Mac Mail doesn't work AT ALL - any help changing the settings back to correct Mac Mail settings? I can provide a transcript of the entire tech chat session, if that will help...

    both apostrophes are used correctly, thanks
    doesn't = does not (this is called a contraction)
    it's = it is
    Mac Mail's fault = possessive
    any help with the actual issue? thanks!

  • HT6030 Since I did the update, my mail-programm doesn't work no more. So I cannot send any eMail out or change the text into the eMail. Help, this is a catastrophe!!! Lukas Schmid

    Since I did the Mavericks-update, my mail-programm doesn't work no more. So I cannot send any eMail out or change the text into the eMail. Help, this is a catastrophe!!! Lukas Schmid

    Hey Lukas Schmid,
    The following resource may provide more help in troubleshooting Mail for OS X:
    OS X Mail: Troubleshooting sending and receiving email messages
    http://support.apple.com/kb/TS3276
    For more information, you can also visit http://www.apple.com/support/mail/
    Thanks,
    Matt M.

  • My email says it's checking mail but doesnt find any and doesn't change update time

    My email says it's checking mail but doesnt find any and doesn't change update time. Only started today. Have checked settings and tried turning off to no help. Can anyone help?

    which email account is it? is it happening with all accounts or just one? Have you tried closing the mail app out of multitasking?

  • Mail not working after change of password

    Yesterday I changed my emai password (using my ISPs web site). All my other email clients can log in and download new mails using the new password. But Snow Leopard's 'Mail' client refuses to log in - telling me that my ISP has rejected the password. I know I've typed it in correctly. Can anyone suggest what might be wrong?

    AFAICT Apple's Mail app doesn't like passwords with numbers in them. Surely this can't be right???
    I have three email accounts. Two of thme have passwords containing only letters. Apple Mail accesses them both fine, even if I change the password (as long as it only includes letters). But for whatever reason, one of my Mail providers insisted I change the passwrod to include at least one number. Apple's Mail app now steadfastly refuses to access that account (although my Windows email clients have both accepted the change without any problem).
    Is this a bug in Apple Mail?

  • When I share a pages document as a PDF (via e-mail) all the pictures change from the original document, most are missing with just a few of them repeated in the spots where others had been.  How do I do this without the document changing?

    When I share a pages document as a PDF (via e-mail) all the pictures change from the original document, most are missing with just a few of them repeated in the spots where others had been.  How do I do this without the document changing?
    I need to be able to send it to a PC in order to print it.

    Hard to say what is happening without examining the file.
    If you like click on my blue name and email me both the .pages file and the the .pdf you have made from it.
    Peter
    ps It would help to say what version of Pages you are using and on what you are running it. iOS or Mac and what version.

  • On my app store I what to update an app but the e-mail is my husband it in a light color making it so I can't change it to my e-mail address. It ask for a password can't give one because of the e-mail how do I change this I'm lock out?

    On my app store I what to update an app but the e-mail is my husband it in a light color making it so I can't change it to my e-mail address. It ask for a password can't give one because of the e-mail how do I change this I'm lock out?

    This is your husband's app, only your husband can update it. Apps are forever tied to the Apple ID that purchased them. No other Apple ID can update someone else's app.

  • Mail...writing changes to disk...taking forever!

    My Mail has been rendered useless since Mavericks upgrade.  I have installed the initial patch and the most recent Mavericks update.  Same problem persists...
    Mail takes forever to load
    Mail is always writing changes to disk
    I love Mail - but it is useless now.  Frustrating.
    Most of my mail accounts are Gmail. 

    I cannot cope with this any longer, I am using a MacBook Pro and the machine is unusable since upgrading to Mavericks. Mail is churning constantly and I cannot do anything else with the machine. Can anyone suggest a new email programme or either on Mac or PC? I am sorry Apple but you have failed me for the final time with this upgrade.

  • Mail server doesn't work after upgrading from SL to ML

    My Mail server doesn't work after upgrading from SL to ML
    Mail client connects with the Mail Server wich seems to run but then they can't receive any email...
    the problem seems to be related with dovecot ... in my smtp log i get this:
    relay=dovecot, delay=324, delays=324/0.02/0/0.01, dsn=4.3.0, status=deferred (temporary failure. Command output: pipe: fatal: pipe_command: execvp /usr/libexec/dovecot/deliver: Permission denied
    I have to say that in the usr/libexec there wasn't the dovecot directory so I just tried to create one but with no luck
    Any Ideas?
    Cheers
    Carlo
    This is my postconf -n info:
    server:Data admin$ postconf -n
    biff = no
    command_directory = /usr/sbin
    config_directory = /Library/Server/Mail/Config/postfix
    content_filter = smtp-amavis:[127.0.0.1]:10024
    daemon_directory = /usr/libexec/postfix
    data_directory = /Library/Server/Mail/Data/mta
    debug_peer_level = 2
    debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin xxgdb $daemon_directory/$process_name $process_id & sleep 5
    dovecot_destination_recipient_limit = 1
    enable_server_options = yes
    header_checks = pcre:/etc/postfix/custom_header_checks
    html_directory = /usr/share/doc/postfix/html
    imap_submit_cred_file = /Library/Server/Mail/Config/postfix/submit.cred
    inet_interfaces = all
    inet_protocols = ipv4
    mail_owner = _postfix
    mailbox_size_limit = 0
    mailbox_transport =
    mailq_path = /usr/bin/mailq
    manpage_directory = /usr/share/man
    maps_rbl_domains =
    message_size_limit = 20971520
    mydestination = $myhostname, localhost.$mydomain, localhost
    mydomain = moremoremore.it
    mydomain_fallback = localhost
    myhostname = server.moremoremore.it
    mynetworks = 127.0.0.0/8,192.168.178.0/24
    newaliases_path = /usr/bin/newaliases
    queue_directory = /Library/Server/Mail/Data/spool
    readme_directory = /usr/share/doc/postfix
    recipient_delimiter = +
    relayhost = mail.mclink.it
    sample_directory = /usr/share/doc/postfix/examples
    sendmail_path = /usr/sbin/sendmail
    setgid_group = _postdrop
    smtp_sasl_auth_enable = no
    smtp_sasl_password_maps =
    smtpd_client_restrictions = permit_mynetworks permit_sasl_authenticated reject_rbl_client zen.spamhaus.org permit
    smtpd_enforce_tls = no
    smtpd_helo_required = yes
    smtpd_helo_restrictions = reject_invalid_helo_hostname reject_non_fqdn_helo_hostname
    smtpd_pw_server_security_options = cram-md5,gssapi
    smtpd_recipient_restrictions = permit_sasl_authenticated permit_mynetworks reject_unauth_destination check_policy_service unix:private/policy permit
    smtpd_sasl_auth_enable = yes
    smtpd_tls_CAfile = /etc/certificates/server.moremoremore.it.A358901573EE7B9B4D489725407934780D24D5 36.chain.pem
    smtpd_tls_cert_file = /etc/certificates/server.moremoremore.it.A358901573EE7B9B4D489725407934780D24D5 36.cert.pem
    smtpd_tls_exclude_ciphers = SSLv2, aNULL, ADH, eNULL
    smtpd_tls_key_file = /etc/certificates/server.moremoremore.it.A358901573EE7B9B4D489725407934780D24D5 36.key.pem
    smtpd_use_pw_server = yes
    smtpd_use_tls = yes
    tls_random_source = dev:/dev/urandom
    unknown_local_recipient_reject_code = 550
    virtual_alias_maps =
    server:Data admin$

    if this could help:
    mail:setStateVersion = 1
    mail:readWriteSettingsVersion = 1
    mail:connectionCount = 11
    mail:servicePortsRestrictionInfo = _empty_array
    mail:protocolsArray:_array_index:0:status = "ON"
    mail:protocolsArray:_array_index:0:kind = "INCOMING"
    mail:protocolsArray:_array_index:0:protocol = "IMAP"
    mail:protocolsArray:_array_index:0:state = "RUNNING"
    mail:protocolsArray:_array_index:0:error = ""
    mail:protocolsArray:_array_index:1:status = "ON"
    mail:protocolsArray:_array_index:1:kind = "INCOMING"
    mail:protocolsArray:_array_index:1:protocol = "POP3"
    mail:protocolsArray:_array_index:1:state = "RUNNING"
    mail:protocolsArray:_array_index:1:error = ""
    mail:protocolsArray:_array_index:2:status = "ON"
    mail:protocolsArray:_array_index:2:kind = "INCOMING"
    mail:protocolsArray:_array_index:2:protocol = "SMTP"
    mail:protocolsArray:_array_index:2:state = "RUNNING"
    mail:protocolsArray:_array_index:2:error = ""
    mail:protocolsArray:_array_index:3:status = "ON"
    mail:protocolsArray:_array_index:3:kind = "OUTGOING"
    mail:protocolsArray:_array_index:3:protocol = "SMTP"
    mail:protocolsArray:_array_index:3:state = "RUNNING"
    mail:protocolsArray:_array_index:3:error = ""
    mail:protocolsArray:_array_index:4:status = "OFF"
    mail:protocolsArray:_array_index:4:kind = "INCOMING"
    mail:protocolsArray:_array_index:4:protocol = "Junk_mail_filter"
    mail:protocolsArray:_array_index:4:state = "STOPPED"
    mail:protocolsArray:_array_index:4:error = ""
    mail:protocolsArray:_array_index:5:status = "OFF"
    mail:protocolsArray:_array_index:5:kind = "INCOMING"
    mail:protocolsArray:_array_index:5:protocol = "Virus_scanner"
    mail:protocolsArray:_array_index:5:state = "STOPPED"
    mail:protocolsArray:_array_index:5:error = ""
    mail:startedTime = "2013-01-21 21:18:32 +0000"
    mail:logPaths:IMAP Log = "/Library/Logs/Mail/mailaccess.log"
    mail:logPaths:Server Log = "/Library/Logs/Mail/mailaccess.log"
    mail:logPaths:POP Log = "/Library/Logs/Mail/mailaccess.log"
    mail:logPaths:SMTP Log = "/var/log/mail.log"
    mail:logPaths:Migration Log = "/Library/Logs/MailMigration.log"
    mail:logPaths:Virus Log = "/Library/Logs/Mail/clamav.log"
    mail:logPaths:Amavisd Log = "/Library/Logs/Mail/amavis.log"
    mail:logPaths:Virus DB Log = "/Library/Logs/Mail/freshclam.log"
    mail:imapStartedTime = "2013-01-21 21:18:34 +0000"
    mail:servicePortsAreRestricted = "NO"
    mail:state = "RUNNING"
    mail:postfixStartedTime = "2013-01-21 21:18:32 +0000"

  • How do i delete a stationery in mail that doesn't have the X

    How do i delete a stationery in mail that doesn't have the X to delete it and its beger then the rest of my other stationery

    "when I try save to PDF it just wants to save it to a file?"
    Correct. The difference between "Mail PDF" and "Save PDF" is that the first opens a new Mail message with the file attached. the second saves a file which you may attach to an email message.
    "Terrainathome is a good example of what I am trying to do."
    Not familiar with Terrainathome, but my guess is that the company is sending an email message containing HTML code that downloads what's essentially a web page into the displayed message. To do that, you'll need a website, software that will produce the necessary HTML code, and recipients with email clients capable of interpreting HTML (which is 'most email clients' these days).
    Regards,
    Barry

  • When I copy and paste from Word to my e-mail using Firefox it changes the font and spacing to single and 10pt. It just started doing this a month ago. It does not do it when I am on my laptop or using Explorer. Help, I hate explorer.

    When I copy and paste from Word to my e-mail using Firefox it changes the font and spacing to single space and 10pt.
    It just started doing this a month ago.
    It does not do it when I am on my laptop or using Explorer.
    Help, I hate explorer.

    If this were a project that I was involved in, I would recapture the media at the correct frame rate and rebuild the sequences correctly.
    Moving from production, to post production, to delivery is a series of steps, and the success of any particular step is based on having all the preceding steps done correctly.
    Shortcuts and workarounds tend to create awkward and difficult problems, that often only surface late in the process.
    MtD

  • I reset my apple ID password and realized my e-mail address has been changed.  I cannot retrieve my password because I cannot get the email.  So I am stuck in a loop with the apple support page.  I cannot change my forgotten password or my email address?

    I lost my passwrod and my e-mail address has now changed.  On the support page I cannot reset my password without my old e-mail and I cannot change my e-mail address without my password.  Any thoughts?

    You apparently did not migrate your MobileMe account to iCloud before 1 August? In this case your MobileMe account has been permanently deleted and all its contents lost, as was announced over a year ago.
    Your signature says your Mac has 10.6.8; you cannot set up an iCloud account on that. However you can reactivate your @me.com address (though not retrieve its contents including any aliases) by going to Settings>iCloud on your iPhone (iOS5 required), signing in with your @me.com address and password, and enabling Mail in the list there.
    That done, you can set up Mail manually on Snow Leopard to access your iCloud email:
    Entering iCloud email settings manually in Snow Leopard or Leopard

Maybe you are looking for

  • Exception while loading jars

    Hello. Sometimes when starting applet I get exceptions during loading: com.sun.deploy.net.FailedDownloadException: Unable to load resource: http://gier.gamepoint.net/games/common-images-lobby_20110907_2_cleaned.jar.pack.gz      at com.sun.deploy.net.

  • How to set up Bluetooth with iPhone and computer

    Hi there. I am now the proud owner of a brand new iPhone 3GS 32GB and I'm in love... I'm trying to set it up with Bluetooth. I used to be able to "Bluetooth" files to and from my computer with other mobile devices but I have difficulties with the iPh

  • I am getting double emails

    after a delayed time, I am getting the same email again, it shows up right below the email that I previously received and goes back in time 15 days . It seems like it doesn't happen with every email, but a lot.

  • IMovie 11 Issues

    I use iMovie 11. I have a macbook pro 15 inch that I got over the summer. Every weekend I edit a new video on iMovie 11. However, last weekend, I opened iMovie and the viewer was grey. The viewer is the video part of iMovie that plays back everything

  • Soundbooth CS4 crashing on startup...

    I've looked elsewhere on the forum, but it doesn't appear this has been answered. I'm getting the following error when on startup of Adobe Soundbooth CS4: "/Gogo/main/MediaCore/ASL/Foundation/Make/Mac/../../Src/DirectoryRegi stry.cpp-283". In fact, i