Email attachment Dynamic Name:

Hi
I have to send the Email with the content and the attachments, here the email content and attachemts contains different set of data , attachment needs to be an .HTML file which has to be generated during the mapping & its content is the part of the email body content...and the attachment name is dynamic...like PO Number or customer name
i am going through the Stefan's blog: /people/stefan.grube/blog/2007/04/17/xi-mail-adapter-an-approach-for-sending-emails-with-attachment-with-help-of-java-mapping
i am not getting the email content and the payload, in this blog dosn't  mentioned about any module to be put in the email receiver...kindly let me know i am missing something from this blog?
i am getting the payload as mentioned in the blog but at the receiver side i am not getting email content & body...am receiving mail with only subject...
regadrs
Nisar
The receiver paylod is genereated as follows:
"----AaZz Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline This is a sample file -AaZz Content-Type: application/xml; name=file.xml Content-Disposition: attachment; filename=file.xml <?xml version="1.0" encoding="UTF-8" ?><ORDERS05><IDOC BEGIN="1"><EDI_DC40 SEGMENT="1"><TABNAM>EDI_DC40</TABNAM><MANDT>021</MANDT><DOCNUM>0000000045565114</DOCNUM><DOCREL>620</DOCREL><STATUS>30</STATUS><DIRECT>1</DIRECT><OUTMOD>2</OUTMOD><IDOCTYP>ORDERS05</IDOCTYP><MESTYP>ORDRSP</MESTYP><STDMES>ORDRSP</STDMES><SNDPOR>SAPBC3</SNDPOR><SNDPRT>LS</SNDPRT><SNDPRN>BC3-021</SNDPRN><RCVPOR>XID100</RCVPOR><RCVPRT>LS</RCVPRT><RCVPRN>XID100</RCVPRN><CREDAT>20080527</CREDAT><CRETIM>112753</CRETIM></EDI_DC40><E1EDK01 SEGMENT="1"><ACTION>12</ACTION><ZTERM>12</ZTERM><NTGEW>21</NTGEW></E1EDK01><E1EDK14 SEGMENT="1"></E1EDK14><E1EDK03 SEGMENT="1"></E1EDK03><E1EDK04 SEGMENT="1"></E1EDK04><E1EDK05 SEGMENT="1"></E1EDK05><E1EDKA1 SEGMENT="1"><E1EDKA3 SEGMENT="1"></E1EDKA3></E1EDKA1><E1EDK02 SEGMENT="1"></E1EDK02><E1EDK17 SEGMENT="1"></E1EDK17><E1EDK18 SEGMENT="1"></E1EDK18><E1EDK35 SEGMENT="1"></E1EDK35><E1EDK36 SEGMENT="1"></E1EDK36><E1EDKT1 SEGMENT="1"><E1EDKT2 SEGMENT="1"></E1EDKT2></E1EDKT1><E1EDP01 SEGMENT="1"><E1EDP02 SEGMENT="1"></E1EDP02><E1CUREF SEGMENT="1"></E1CUREF><E1ADDI1 SEGMENT="1"></E1ADDI1><E1EDP03 SEGMENT="1"></E1EDP03><E1EDP04 SEGMENT="1"></E1EDP04><E1EDP05 SEGMENT="1"><E1EDPS5 SEGMENT="1"></E1EDPS5></E1EDP05><E1EDP20 SEGMENT="1"></E1EDP20><E1EDPA1 SEGMENT="1"><E1EDPA3 SEGMENT="1"></E1EDPA3></E1EDPA1><E1EDP19 SEGMENT="1"></E1EDP19><E1EDPAD SEGMENT="1"><E1TXTH1 SEGMENT="1"><E1TXTP1 SEGMENT="1"></E1TXTP1></E1TXTH1></E1EDPAD><E1EDP17 SEGMENT="1"></E1EDP17><E1EDP18 SEGMENT="1"></E1EDP18><E1EDP35 SEGMENT="1"></E1EDP35><E1EDPT1 SEGMENT="1"><E1EDPT2 SEGMENT="1"></E1EDPT2></E1EDPT1><E1EDC01 SEGMENT="1"><E1EDC02 SEGMENT="1"></E1EDC02><E1EDC03 SEGMENT="1"></E1EDC03><E1EDC04 SEGMENT="1"></E1EDC04><E1EDC05 SEGMENT="1"></E1EDC05><E1EDC06 SEGMENT="1"></E1EDC06><E1EDC07 SEGMENT="1"></E1EDC07><E1EDCA1 SEGMENT="1"></E1EDCA1><E1EDC19 SEGMENT="1"></E1EDC19><E1EDC17 SEGMENT="1"></E1EDC17><E1EDC18 SEGMENT="1"></E1EDC18><E1EDCT1 SEGMENT="1"><E1EDCT2 SEGMENT="1"></E1EDCT2></E1EDCT1></E1EDC01></E1EDP01><E1CUCFG SEGMENT="1"><E1CUINS SEGMENT="1"></E1CUINS><E1CUPRT SEGMENT="1"></E1CUPRT><E1CUVAL SEGMENT="1"></E1CUVAL><E1CUBLB SEGMENT="1"></E1CUBLB></E1CUCFG><E1EDL37 SEGMENT="1"><E1EDL39 SEGMENT="1"></E1EDL39><E1EDL38 SEGMENT="1"></E1EDL38><E1EDL44 SEGMENT="1"></E1EDL44></E1EDL37><E1EDS01 SEGMENT="1"></E1EDS01></IDOC></ORDERS05>"
The Email Body content should be
" This is a sample file"
the attachment should be the IDOC strucutre which is getting stored as .HTML file....
kindly let me know what are the things that i need to take care in the receiver mail adapter to separate these two....
Edited by: Nisar Khan on May 27, 2008 8:59 PM

Sorry made simple mistake in reciver mail adapter....works good now.....stefans blog is excellent.

Similar Messages

  • How to get email attachment file name?

    Hi,
    I have a macro that executes when the user sends an email. In this macro, I want to get the subject of the email itself and the titles of all of its attachments (be they documents or other attached emails).
    To get the email subject, I use Groupwise.ComposingItem.subject
    To get the attachment filename, I use Groupwise.ItemAttachmentGetDisplayName("X00", <attachment_index>)
    However, this call only seems to work for document attachments. For other emails attached to the current email, this call returns "Mail Attachment" instead of the name of the attached email. How can I get the name (i.e. subject) of the attached email?
    Thank you,
    Monika

    Hi Experts,
    i try useing the DMS_KPRO_READ prog as you said above.
    The problem is that i need to retrieve list  (range) of documents and than save them.
    as it written now , i can do it just about one file.
    if u have any helpfull advice it will be real kindly.
    Thanks alot.
    Yuval.
    Edited by: student student on Nov 16, 2009 10:20 AM

  • Scheduled email attached Report Name needs to be changed.

    In Crystal Reports Server 2008, I have a scheduled a Publication report using dynamic parameters. The report is exported to a PDF. The PDF is emailed as an attachment.  I would like to create the name of the attachment from a field inside the report. I will assume that I could use the .NET SKD and create a Publication Extension? If anybody has run accoss this need and has a better work around please let me know.
    Thanks in advance for any advice.

    you can create a ublication extension to rename the pdf file before delivery ( PostProcessing) but I don't think .NET SDK can be used for it, the APIs are available only in Java SDK.

  • Email attachment file name

    Hi,
    I have a macro that executes when the user sends an email. In this macro, I want to get the subject of the email itself and the titles of all of its attachments (be they documents or other embedded emails that were attached).
    To get the email subject, I use Groupwise.ComposingItem.subject
    To get the attachment filename, I use Groupwise.ItemAttachmentGetDisplayName("X00", <attachment_index>)
    However, this call only seems to work for document attachments. For other emails embedded in the current email as attachments, this call returns "Mail Attachment" instead of the name of the attached email. How can I get and modify the name (i.e. subject) of the attached email?
    Thank you,
    M

    Embedded emails do not have names.
    If you want a name for an embedded email, you will
    have to read the embedded email and get the subject.
    You can not modify embedded emails.
    Peston
    >>> On Tuesday, September 28, 2010 at 6:50 AM, MK<[email protected]> wrote:
    > Hi,
    >
    > I have a macro that executes when the user sends an email. In this macro,
    I
    > want to get the subject of the email itself and the titles of all of its
    > attachments (be they documents or other embedded emails that were
    attached).
    >
    > To get the email subject, I use Groupwise.ComposingItem.subject
    >
    > To get the attachment filename, I use
    > Groupwise.ItemAttachmentGetDisplayName("X00", <attachment_index>)
    >
    > However, this call only seems to work for document attachments. For other
    > emails embedded in the current email as attachments, this call returns
    "Mail
    > Attachment" instead of the name of the attached email. How can I get and
    > modify the name (i.e. subject) of the attached email?
    >
    > Thank you,
    > M

  • Email attachment file names

    I have a sender mail adapter that picks up emails with file attachments from a mail box using the IMAP transport protocol.
    The mail adapter passes processing onto the PayloadSwapBean and then onto a customised module that processes the file attachment (a CSV file).
    When I use the messaging system i.e. http://xiserver:port/MessagingSystem/monitor/monitor.jsp
    I can see that Content-Type includes the attachment's file name:-
    Content-Type: application/octet-stream;name="INV_5016888091848_20060912_00001.csv"
    Content-Disposition: attachment;filename="MailMessage.bin"
    Content-Description: MailMessage
    In my customised module I would like to pick up this file name so that it can be stored in a database table. I have attempted to pick up this file name from the payload using the "getContentType" method of the "XMLPayload" class but this only returns "application/octet-stream" and does not include the file name.
    Does anyone know how I can get hold of the above file name using the Adapter Framework API? Or, alternatively, by some other method/approach.
    Any help on this would be greatly appreciated.

    Hi,
    I never used this but an idea.Have a try ..
    Please chcek this link -
    http://help.sap.com/saphelp_nw04/helpdata/en/8d/a9d240a0a98431e10000000a1550b0/frameset.htm
    Please check for Adapter -Specific Message Attributes
    ->To store adapter attributes in the message header of the XI message, set the Use Adapter-Specific Message Attributes indicator.
    The following attributes are added to the XI message header if the sender makes them available, and if you choose Variable Transport Binding.
    To transfer further header fields, set the relevant indicator. You can then store the following attributes and their values in the XI message header:
    You can set the details in header with the file names you required  like this Variable Header-> XHeaderName1
    Nanda

  • Dynamic name for email attachment

    Hi all
    I have a scenario where i have to change the name of the email attachment dynamically in the UDF or using Modules
    Requesting you to help me with this please.
    Your help is highly rewardful.
    --Keerhi

    Hi Keerthika,
    Please refer the weblink below:
    http://wiki.sdn.sap.com/wiki/display/SI/DynamicEmailAttachmentnameforReceivedMails
    Thanks,

  • How do I customize the Email Attachment name in Email Bursting?

    I had worked on BI Publisher extensively on 10g and 11g. I have a client requirement with BIP email bursting to deliver the reports as email attachments. I'm able to do it, and also customize mail body etc. However the email attachment file name is randomly generated with some numbers. I read through the docs, and couldn't find any parameter mapping to the attachment/file name (like we do it with File bursting). How do I specify the mail attachment file names in my Busrting properties?
    Thanks,
    Padma

    Please go through the following link:
    http://garethroberts.blogspot.com/2008/03/bi-publisher-ebs-bursting-101.html
    I think after the 'Output' we can specify the filename

  • Setting up the File Name of email Attachment from Received File Name

    Hello All,
    I have to send the Received File in attachment to an Email if there is any exception. Here I can attach the file, but I cannot set the file name of attachment as the Received File Name. Is there anyway of doing this without using custom pipeline component.
    Here I am using the Orchestration and SMTP Adapter.Any help is greatly appreciated.
    Thanks

    It might work if you use a custom pipeline component on your send port and in the Execute method populate the MIME.FileName property of the body part.
    Something like:
    public IBaseMessage Execute(IPipelineContext pc, IBaseMessage inmsg)
    string filename = inmsg.Context.Read("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties");
    inmsg.BodyPart.PartProperties.Write( "FileName", "http://schemas.microsoft.com/BizTalk/2003/mime-properties", "filename);
    return inmsg;
    You can take reference from similar post here
    SMTP - Setting attachment filename
    Anther good article with MIME is here
    Setting attachment filename with the SMTP Adapter
    For MIME case your SMTP message construct statement would be like below
    multipartMessage.MessagePart_1= InMSG;
    multipartMessage.MessagePart_2="This is message part2 as a string";
    multipartMessage(SMTP.Subject) ="Email From Dynamic Port";
    multipartMessage(SMTP.From) ="[email protected]";
    multipartMessage(SMTP.SMTPHost) ="yoursmypserver.com";
    multipartMessage.MessagePart_2(MIME.FileName) = "Attachment_Name";
    multipartMessage(SMTP.SMTPAuthenticate) =0;
    Thanks
    Abhishek

  • Dynamic Email Attachment

    Hi,
    1. I need to send a word document as attachment in email using BPEL process, but the document name I will get in Payload. So how can I provide dynamic name of file.
    2. Can we pick files for attachments from a remote ftp server, or it is possible only from the server where SOA is installed.
    Thanks.

    In the Email Activity you have to select multipart message checkbox for 2-3 or more attachments.
    Then if you observe the Email Activity code in Source tab, you will find that for all attachments we need to set three values MimeType, Doc name(BodyPartName) and ContentBody (email body content). In your case, you will be able to assign mime type and doc name easily. You can have your file content stored in "base64Binary"/String type of variable and you can assign it here.
    Yes, we can read the file from remote ftp server. You can get idea here http://web.deu.edu.tr/oracle/B14099_16/integrate.1012/b25307/adptr_file.htm. Also on soa server, you can find sample application in <soa_home>/bpel/samples/tutorials/129.FTP Adapter folder.
    hope this will help,
    Nirav

  • Retrieve file name of email attachment

    Hi,
    it's getting more and more absurd about the fact that it is not possible to get the file name of an email attachment. It's not possible by writing a module (getName(), getContentType() nor getDescription() doesn't work) or by accessing mailadapter specific message attributes.
    I mean it's a basic requirement. Why is it so diffcult to implement it???
    -Steffen
    (frustrated)

    Hi,
    See the below links
    /people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
    http://help.sap.com/saphelp_nw04/helpdata/en/23/c093409c663228e10000000a1550b0/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/f1/9ef1680efbec4c9656eb028c44ab0b/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/ad/bf93409c663228e10000000a1550b0/frameset.htm
    Mail adapter
    Regards
    Chilla..

  • Email attachment name in sender mail adapter to the receiver file adapter

    HI ,
    Ths is regarding email to file scenario. I am trying to create file (in rceiver file adapter) with the same name as the email attachment that i read from mail sender adapter. I want ro use adapter module for this. I could find from blogs that there is module - GetAttachmentName - available that i can use for this in sender mail adapter.
    Can you please let me know what whetehr i neeed to mention any module key and parameters for this.
    I assume , i need to do following steps :Please confirm.
    1. i can use this module - after payload swap module and before standard mail adapter module in sender mail adapter
    2. select ASMA option in advanced tab in sender mail adapter
    3. In receiver file adapter select ASMA option in advanced tab in sender mail adapter
    4. Also select file name option in ASMA in sender mail adapter
    Thanks,
    Vamsi

    Hi Vamsi,
    your scenario is also described here: Re: sender mail adapter - attachment name
    If you use the Module getAttachmentName, which is described here,
    http://wiki.sdn.sap.com/wiki/display/XI/AdapterModulePI7.0GetAttachmentName
    your scenario should work as you described it.
    You just need to make sure that the Attachment Name that you read in the first place, is mapped to the Filename Attribute of the
    Fileadapter (http://sap.com/xi/XI/System/File/FileName).
    regards,
    Daniel

  • B2B outbound Channel Configuration - EMail - Attachment Name and Extension

    Hello,
    I have configured an outbound channel to send the payload (xml) as an attachment. When I leave the "Subject" field in the Channel configuration blank, the attachment file name looks like this,"HostPartnerName_TradingPartnerName_DocumentType" without the file extension. If I supply the "Subject" field with the value, the file name gets replaced with the subject and the file extension still is missing.
    I would like to receive a file name in a format like "batch_b2b.messageId.xml". The property b2b.messageId gets the value from the Mediator. The composite that passes the information like the b2b properties has been made generic to handle different Trading Partners, so for a channel that uses SFTP, I have used the Filename format and supplied the value as "batch_%MSG_ID%.xml". Is there a way I can do the same for Email channel?
    Thanks,
    Venkatesh

    Hi Venkatesh,
    Attachment name can be set from the middleware using below header (as per the mode of integration used) -
    1. For AQ mode of integration, use actionName -
    actionName=ATTACHMENT_NAME:test.txt
    2. For JMS mode of integration use custom JMS header - jca.jms.JMSProperty.ATTACHMENT_NAME to populate the name.
    3. For fabric (default) mode of integration, use b2b.attachmentName header
    Regards,
    Anuj

  • Get file name of an email attachment with sql query

    Hi all,
    How can I get the file name of an email attachment with a sql or pl/sql query?
    Thanks in advance.
    Edited by: JonasZzZz on Sep 14, 2009 10:52 AM

    Hi, anynone? please..

  • Dynamic name for attachment in the Receiver Mail Communication Channel

    Hi All,
    I want to dynamically set the name of attachment in receiver mail Communication Channel.
    Example: IN__9907211000004_4048454000005_20081211_01000000002643
    The first two numbers 9907211000004 & 4048454000005 I want to read it from the message
    20081211 this is the date and
    And againg this number 01000000002643 is read from message.
    What is the procedure to create Adapter Module? I am new to Adapter Module.
    Any Ideas ideas?
    Thank You,
    Mukhtar

    Hi Michal,
    I had a look to your blog and tried to modify according to my requirement.
    Here is the code
    import javax.ejb.CreateException;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    import com.sap.aii.af.mp.module.*;
    import com.sap.aii.af.ra.ms.api.*;
    @ejbHome <{com.sap.aii.af.mp.module.ModuleHome}>
    @ejbLocal <{com.sap.aii.af.mp.module.ModuleLocal}>
    @ejbLocalHome <{com.sap.aii.af.mp.module.ModuleLocalHome}>
    @ejbRemote <{com.sap.aii.af.mp.module.ModuleRemote}>
    @stateless
    public class SetAttachmentName implements SessionBean, Module{
         private SessionContext myContext;
         public void ejbRemove() {
         public void ejbActivate() {
         public void ejbPassivate() {
         public void setSessionContext(SessionContext context) {
              myContext = context;
         public void ejbCreate() throws CreateException {
    public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData)
                          throws ModuleException{
         try {
    Message msg = (Message) moduleData.getPrincipalData();
    //creating parsable XML document
    InputStream XIStreamData = null;          
    XMLPayload xmlpayload = msg.getDocument();
    XIStreamData = xmlpayload.getInputStream();
    DocumentBuilderFactory  docBuilderFactory = DocumentBuilderFactory.newInstance();               
    DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
    Document doc = docBuilder.parse(XIStreamData);
    //finding the tag's name from the Modules tab in the Directory that will hold the attachment's name
    String SenderIDTag = null;
    SenderIDTag = moduleContext.getContextData("SenderIDTag");
    //finding the content of the tag that will be used as the attachment's name (assuming it's the only tag with this name)
    Element element = doc.getDocumentElement();     
    NodeList list = doc.getElementsByTagName(SenderIDTag);
    mailFileName += "_" + list.item(0).getFirstChild().toString();
    String anIDTag = null;
    ReceiverIDTag = moduleContext.getContextData("ReceiverIDTag");     
    element = doc.getDocumentElement();     
    list = doc.getElementsByTagName(ReceiverIDTag);
    mailFileName += "_" + list.item(0).getFirstChild().toString();
    Date date= new Date(System.currentTimeMillis());
    //Add date to the Message
    SimpleDateFormat dateFormat= new SimpleDateFormat("yyyyMMdd");
    mailFileName += "_" + dateFormat.format(date);
    String BillNrTag = null;
    BillNrTag = moduleContext.getContextData("BillNrTag");     
    element = doc.getDocumentElement();     
    list = doc.getElementsByTagName(BillNrTag);
    mailFileName += "_" + list.item(0).getFirstChild().toString();
    //creating the attachment
    byte by[] =  xmlpayload.getText().getBytes();
    XMLPayload attachmentXML = msg.createXMLPayload();
    attachmentXML.setName(mailFileName);
    attachmentXML.setContentType("text/pdf");
    attachmentXML.setContent(by);
    //adding the message to the attachment
    msg.addAttachment(attachmentXML);
            inputModuleData.setPrincipalData(msg);
        } catch (Exception e) {
            throw new ModuleException(e);
        return inputModuleData;
    I hope this is right Adapter Module coe for my requirement.
    Thank you in Advance,
    Mukhtar

  • How to set dynamic name of the mail attachment according to source file ?

    Hi,gurus:
    Our scenario is like below:
    Sending files from an FTP server to another FTP server without using the integraiton repositary,and the file name is not changed .Now, we want to also send the file to some with by mail adapter.The scenario  now works by using two business services in receiver determination.But the name of the attachment is "untitled.xml".We know how to set the file name staticly,but how to set the name dynamicly according to the source file name ?
    I have checked miachel's blog "XI: Dynamic name in the mail attachment - pseudo "variable substitution"(/people/michal.krawczyk2/blog/2006/02/23/xi-dynamic-name-in-the-mail-attachment--pseudo-variable-substitution),but how can I get the source file name?
    And another question:Must we restart the adapter or j2ee engine to make the user defined module work?

    Hi,
    >>>but how can I get the source file name?
    form dynamicconfiguration (ASMA)
    >>>And another question:Must we restart the adapter or j2ee engine to make the user defined module work?
    no need for a restart
    Regards,
    Michal Krawczyk

Maybe you are looking for