Receiver Email Adapter - Attachment Rename!!!

Hello All,
We are using PI 7.11 SP05. We have a scenario where a file has to be written in a folder as well as sent as an email attachment. The Email attachment should be zipped and the name of that attachment should be filename with extension zi. For an example, if the filename is abc.xml, the atatchment name should be abc.xml.zip . I have the file name (in this case abc.xml) in the dynamic configuration parameter. I wrote a custom adapter module to achieve this result. I'm using this custom adapter module after the payloadzip beanbelow given is the code:
Message msg = (Message)moduleData.getPrincipalData();
Payload payload = msg.getDocument();
MessagePropertyKey msgPropertyKey = new MessagePropertyKey("FileName","http://sap.com/xi/XI/System/File");
String fileName = msg.getMessageProperty(msgPropertyKey);
payload.setContentType(contentType  + ";attachment;filename=\"" + fileName + "\";");
payload.setDescription(fileName);
payload.setName(fileName);
msg.setDescription(fileName);
msg.setMainPayload(payload);
moduleData.setPrincipalData(msg);
I could see all these values getting assigned ( from the audit log message after each step). But still the attachment is coming as Maindocument.zip . I Kindly request your suggestions on the same.
PS: I have gone through the blogs of Michal, Stefan Grube and sap wiki code for setting attachment name and implemented the code on the suggestions from these blogs.
Thanks,
Sundar

Hi Sundara Rama,
I understand you want to set name for mail attachment.
SAP Note: Mail Adapter sapnote_0000856599
Q: Can I choose the name of an attachment in the mail?
A: Yes. Most mail clients use some heuristics based on some *MIME headers to derive the name of an attachment.* The MIME headers involved in most heuristics are Content-Type, Content-Description,and Content-Disposition. When you create an XI message, the XI payload name is automatically set in the Content-Description. If you want to change or set all of these headers, you can use the MessageTransformBean module (Note 793922) [Link|http://help.sap.com/saphelp_nwpi711/helpdata/en/57/0b2c4142aef623e10000000a155106/frameset.htm]
in the adapter framework.
Q: How can I set the file name of a mail attachment?
There are several MIME headers that play a role in how the client retrieves the file name of an attachment. Unfortunately, this behavior differs among various mail clients. The reason for this inconsistent behavior comes from the fact that this mechanism has been extended incrementally. The old way is to use the name parameter in the Content-Type header as specified in RFC1341. For example, you can set the content type of an XML attachment as:
Content-Type: application/xml; name="abc.xml"
RFC1521 discourages the use of this name parameter in anticipation of the new header Content-Disposition, which is defined in RFC1806.
With this Content-Disposition header, you can set the file name as:
Content-Disposition: attachment; filename="abc.xml"
Some clients may show the Content-Description value as the file name. The Content-Description header is typically used to associate some descriptive information to an attachment (RFC1341) as in
Content-Description: my xml file
To avoid potential interpretation problems, it is recommended to combine the use of these headers.
Regards,
Raghu_Vamsee

Similar Messages

  • Filename attachment to dynamic email address in receiver email adapter

    Hi,
    Can i send a file with dynamic name to a dyanmically generated Email Id as attachment using receiver Email adapter ?
    Thanks
    Rupesh Kumar

    Hi,
    I had gone through the links given , but it doesn't answer my question completely. I think i need a java code to send dynamically generated filename to be send to dynamically generated email ID.
    The file name and the email Id is available in the sender adapter.
    This filename should be send as attachment to the Email Id using receiver Email adapter.
    Thanks & regards,
    Rupesh

  • Attachments in email whit receiver email adapter

    hello!
    it's possible to send a a file attached into a email whit a receiver email adapter?
    i want take this file from a directory (example whit ftp adapter) and send via email whit XI.
    this is a PDF file and NOT generated from payload.
    thanks
    Alex

    alessandro..
    Check out the links below..might help walk you through it..
    http://www.riyaz.net/blog/index.php/2008/02/23/xipi-sending-emails-using-xi-mail-adapter/
    This is a complete how to pdf
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d0964d7c-e66e-2910-24bb-ac535e4a5992
    Hope that helps
    Regards
    Ravi Raman

  • Need help for Adapter Specific Message Attributes in Receiver Email Adapter

    We want to use Adapter Specifice Message Attributes(ASMA) in Receiver Email Adapter for sending the mails dynamically, and to set the CC and BCC. I have gone through the help give in <a href="http://help.sap.com/saphelp_nw04/helpdata/en/a5/1b5342d8a7be30e10000000a155106/frameset.htm">SAP Help</a>
    not clear how to use it. Please help to configure this.Any blogs?
    with regards,
    Ravi Siddam

    Hi Kumar,
    This blog explains about using 'Mail Package' option. We have already gone through this link and configured as explianed.  1.it dosen't support CC,BCC and 2. it is old way.
    We are on PI 7.0. It is recommended to use ASMA and in this it is possible to use CC and BCC.
    We don't know how to use ASMA. any help?
    with regards,
    Ravi Siddam

  • In my Mac Mail Version 4.5, I am not received email pdf attachement. It is shown in some html like form in message content. Please help

    In my Mac Mail Version 4.5, I am not received email pdf attachement. It is shown in some html like form in message content. Please help

    Erdygirl please be aware you are posting to a public forum.  I have removed your personal information from your previous post.
    Please check your account at http://www.adobe.com/ to locate your serial number.  You can find more information on how to locate your serial number at Find your serial number quickly - http://helpx.adobe.com/x-productkb/global/find-serial-number.html.

  • I receive emails with attached videos in TextEdit and cannot read them

    I am receiving emails with attached videos or documents and when I click to open I get TextEdit back with a bunch of gobblygook of letters,numbers and symbols but no video or legible documents.

    Hi rwebster. Please see here: http://en.wikipedia.org/wiki/E-mail_spam You can avoid directly opening the file:
    # Download the attachment.
    # Scan it at http://www.virustotal.com before opening.
    # Open it by double-clicking it in your file browser.
    If you trust the sender and still want to configure the browser to open the files directly without saving, then please see here: [[Managing file types]]

  • How to send only one (of several) attachment from a receiver email adapter?

    Hi all,
    I have been working with the SAP XI email adapter for some time and now I encountered the following challenge:
    I am receiving a message via email from a partner, call some modules which lead to the generation of 5 attachments in total for the incoming message.
    I then map the MainDocument to a CONTRL message and return it to the sender using the dynamic parameters of both the sender and the receiver email cc.
    I am filling these parameters inside the message mapping; so far I am not using the mailpackage xsd (the only things out of the ordinary are checked boxes for "use adapter specific parameters", "variable transport" and "keep attachments").
    My problem is that the email receiver cc now generates an email with 5 attachments when I need it to add only the CONTRL (aka MainDocument) as attachment to this email.
    Do you know if there is a way to tell the receiver cc to only use one attachment (or to remove attachments from the original message, f.ex. inside the message mapping)?
    Thanks and cheers!
    Stefan

    Hi Stefan,
    >>>>Do you know if there is a way to tell the receiver cc to only use one attachment (or to remove attachments from the original message, f.ex. inside the message mapping)?
    1. It cannot be done in a mapping
    2. have a look at mz blog
    how simple it is to write an adapter that will do what you need
    (just check the delete part of this blog):
    /people/michal.krawczyk2/blog/2006/02/23/xi-dynamic-name-in-the-mail-attachment--pseudo-variable-substitution
    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>

  • Error in Receiver Email adapter

    Hi
    I have done one scenario as file is sender and mail is receiver.
    In message monitoring it is giving success whereas mail is not generated..
    I have checked receiver mail adapter it is giving the following error:
    <b>error occured: [2006-01-09T06:36:47Z] unable to call the mailer; com.sap.aii.messaging.srt.BubbleException: Failed to call the endpoint [null "null"]; nested exception caused by: java.net.SocketException: Software caused connection abort: connect</b>
    can any body suggest me to solve this problem
    Thanks
    N.Prasad Babu

    Hi prases,
    Check the configruation of your mail adapter. Hope this link helps,
    sender  mail adapter
    http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
    receiver mail adapter
    http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
    regards,
    bhavesh

  • Receiving email with attachment in database.

    Hi,
    Can anybody tell me if it is possible to poll an email
    account (eg [email protected]) for emails with attached
    XML files (1 file per mail) and to detach/read the attached XML file,
    Thanks,
    john

    I don't believe there's any packaged way of doing this at the moment. The UTL_SMTP is only capable of sending e-mail.
    You might be able to write something using UTL_TCP, but that's kind of low level. Alternatively, you might be able to do something by wrapping some JavaMail stuff in a Java Stored Procedure. Sorry I can't be any more concrete.
    Cheers, APC

  • Query related to Email adapter

    Hi,
    I have query related to receiver Email adapter. I am able to run a scenario for 2 attachments in receiver mail adapter scenario.
    My scenario is that I am picking up the multiple files using sender file adapter "additonal fiiles" fucntionality and and post the two files as attachments in receiver email adapter. I am picking up two formats: .xml file and PDF and successfully attached to the receiver email adapter.
    My query is is related to Standard module processors sequence.
    For 3 files in mail attachments(.xml , pdf & .txt)  what should be the module processors sequence in receiver email adapter?
    Currently I am using the following module processors sequence
    1     localejbs/AF_Modules/MessageTransformBean                          Local Enterprise Bean     trans2
    2     localejbs/AF_Modules/PayloadSwapBean                          Local Enterprise Bean     swap
    3     localejbs/AF_Modules/MessageTransformBean                          Local Enterprise Bean     trans1
    4     sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean     Local Enterprise Bean     mail
    swap -> swap.keyName -> payload-name
    swap> swap.keyValue> file1
    trans1> Transform.ContentDescription>file1
    trans1> Transform.ContentDisposition>attachment
    trans1> Transform.ContentType>application/pdf;name="file1.pdf"
    trans2>Transform.ContentDescription>file1
    trans2>Transform.ContentDescription>inline
    Can any body tell me what should be the sequence of module processors and the associated parameters so that all formats(.xml , pdf & .txt)  should go as an attachments in the reciever email adapter.
    Thanks & Regards
    Prabhat

    it would be something like this, Try this
    1 localejbs/AF_Modules/PayloadSwapBean Local Enterprise Bean swaptxt
    2 localejbs/AF_Modules/MessageTransformBean Local Enterprise Bean trans3
    3 localejbs/AF_Modules/PayloadSwapBean Local Enterprise Bean swapxml
    4 localejbs/AF_Modules/MessageTransformBean Local Enterprise Bean trans2
    5 localejbs/AF_Modules/PayloadSwapBean Local Enterprise Bean swappdf
    6 localejbs/AF_Modules/MessageTransformBean Local Enterprise Bean trans1
    7 sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean Local Enterprise Bean mail
    swapxml -> swap.keyName -> payload-name
    swapxml> swap.keyValue> file2
    swappdf -> swap.keyName -> payload-name
    swappdf> swap.keyValue> file1
    trans1> Transform.ContentDescription>file1
    trans1> Transform.ContentDisposition>attachment
    trans1> Transform.ContentType>application/pdf;name="file1.pdf"
    trans2>Transform.ContentDescription>file2
    trans2>Transform.ContentDisposition>attachment
    trans2> Transform.ContentType>application/xml;name="file2.xml"
    trans3> Transform.ContentDescription>file3
    trans3> Transform.ContentDisposition>attachment
    trans3> Transform.ContentType>application/txt;name="file3.txt"
    mail --> mime.contenttype   --> multipart/mixed
    I have not tried this myself. but it should work

  • MessageTransformBean bean Question Receiver Mail Adapter

    localejbs/AF_Modules/MessageTransformBean Local EnterpriseBean transform1
    localejbs/AF_Modules/MessageTransformBean Local EnterpriseBean transform2
    sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean Local EnterpriseBean mail
    Module Config:
    transform1 Transform.ContentDisposition attachment;filename="sample.csv"
    transform1 Transform.ContentType text/plain; name="sample.csv"
    transform2 Transform.ContentDescription file1
    transform2  Transform.ContentDisposition inline
    Email body is coming fine but the attachment Name not getting changed to "sample.csv"
    What am I doing Wrong. Experts any advice please ?.

    Hi,
    have a look into this thread where similar issue is discussed
    Re: Mail adapter- Attachment file name of scheme ddmm
    If the requirement is just to have the dynamic name for your email attachment, it can be done using mail package. check this wiki
    http://wiki.sdn.sap.com/wiki/display/SI/DynamicEmailAttachmentnameforReceivedMails
    we have to choose the options 'use mail package' and 'keep attachments' in the receiver email adapter.
    regards,
    francis

  • Send email with Attachment and Message in Body

    Hi All,
    I'm sending an email (Receiver Email Adapter) with a Zipped CSV file as an attachment. I used the following modules to achieve this.
    1     localejbs/AF_Modules/StrictXml2PlainBean                          Local Enterprise Bean     strict2plain
    2     localejbs/AF_Modules/MessageTransformBean                          Local Enterprise Bean     contentType
    3     localejbs/AF_Modules/TextCodepageConversionBean     Local Enterprise Bean     Transform
    4     localejbs/AF_Modules/PayloadZipBean                                               Local Enterprise Bean     zip
    5     sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean     Local Enterprise Bean     mail
    Transform     Conversion.charset     ISO-8859-1
    contentType     Transform.ContentDispostion     attachment;
    contentType     Transform.ContentType     text/plain;charset="UTF-8";name="Attachment.csv"
    contentType     Transform.Description     file
    strict2plain     DATA.endSeparator     \r\n
    strict2plain     DATA.fieldSeparator     ,
    strict2plain     fieldNames     Result
    strict2plain     recordTypes     DATA
    zip     zip.filenameKey     contentType
    zip     zip.mode     zipAll
    My problem now is how to put text content in the body? Please help.

    > My problem now is how to put text content in the body? Please help.
    This is not possible with standard.
    You have to write an adapter module for this.

  • PDF files won't open in received emails (GMail) since update 5.1.1

    I receive emails with attached PDF files for my work, but since the latest update 5.1.1 the PDF files will not download on my iPad 3 wifi. The files are usually around only 50kb in size, but when I tap the attachment in the email, nothing happens. The files also won't work on my iPhone 4S after the latest update too.
    I never had a problem before the latest update, any ideas?

    MIght be helpful to disable Adobe plugin by going to Adobe Reader's Preferences -> Internet and unchecking "Display PDF in browser using".
    Then dump the atrocious bloated Reader.
    See this https://discussions.apple.com/thread/3252667?start=0&tstart=0 for further solutions.

  • Receiver email encoding problem using mail package

    Hi to all.
    I'm facing a email problem. My company email server is workig fine with emails subject but customers email server is making some strange changes when i use special characters such as 'á' or spanish letter 'n with a tail on the top'.
    I set the field 'Content_Type' of the email to 'text/plain; charset=ISO-8859-1' but isn't working. If i remove those special chars, the subject is OK.
    I also tried to add content conversion in the receiver email adapter in module tab but with no possitive results.
    I'm using SAP PI 7.0 sp14.
    Any idea of what is happening?
    Kind regards,
    Inigo.

    If you want to use non-ascii characters in email subject, then you have to apply a special notation for this, like follows:
    =?utf-8?Q?Auftragsbest=C3=A4tigung?= 
    This is email standard. So I recommend not use non-ascii characters in email subject.
    Regards
    Stefan

  • Symantec Mail Security with Exchange 2007 (Emails with Attachment missing)

    HI, i need help here
    I have Win 2008 with Exchange 2007 and Symantec Mail Security. Symantec was working fine until the license expired but it was still fine until yesterday, we realize that we cannot receive email with attachment. after stopping the symantec services, mail
    flow went back to normal. We then remove the program from the control panel.
    Then i found that i cant retrieve or find those emails that was sent to us during a period of ard 6 hours. i tried looking the the Symantec quarantine folder but it is not there.
    Can someone point to me where should i look for the missing mails? When i do a mail flow troubleshoot i can see the logs that it is sent to the mailbox, but from users's outlook inbox, there is no email ??
    Much Appreciated

    Symantec's support group should be able to tell you what happened.
    --- Rich Matheisen MCSE&I, Exchange MVP

Maybe you are looking for

  • 3rd Gen Headphones with Remote + iPad

    I bought a pair of the apple headphones with remote online. I think they are the 3rd gen version. I can't get the remote to work with my iPad Anyone know if these are incompatible for some reason?

  • How to Extract data from a flat file and how to upload it into table

    Hi i want to extract the data from a web page, that data i want to keep in text file. from the text file i want to read it and i want to upload into table can any one help me its very urgent

  • Need Help with Complex Background Images

    Hey, Macromedia, I mean, Adobe Dreamweaver users. I have a dilemma, before you read further, look at this website: https://statons.rtotogo.com/rtotogostore/rto_store/sign_in.asp. Notice the background images. The light tan stripe at the top, the oran

  • BI 7 Quantity Conversion in Business Explorer

    Hello, I'm not getting the result for Quantity Conversion at BEx level in BI 7. I Created Quantity conversion type in RSUOM All table entries are available in T006 table and the units i'm trying to convert are in the same dimension Used this Conversi

  • SCCM client upgrade

    Hi, What are the previous versions of SCCM 2007 client will upgrade by SCCM 2012 R2 client? I mean, if my environment having different versions of SCCM 2007 client installed on the machines and I want to install now SCCM 2012 R2 client by using clien