webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only

Unable to send excel file (xls) along with HTML body in email

  • 1.  Unable to send excel file (xls) along with HTML body in email

    Posted Tue December 21, 2010 03:35 AM

    Hi All,

    webMethods Version 8.0

    We have a requirement to read the incoming email attachment which is an excel(xls or xlsx) file and process it.We have to send the response email along with the same attachment that was received and the body of reply email should be in HTML format.

    I am able to read the email attachment through e-mail Listener and process it. I am able to send the HTML reply email with received excel file
    as attachment. But the problem is attachment content is coming as Empty and also the file size became 265 bytes and the original file size is 26 KB.

    Could you please let me know if I am missing any thing in the following code:

    1. pub.mime:createMimeData

    2. Map step (This step prepares the HTML body message)

    3. pub.io:stringToStream (This step converts the HTML body message from step 2 into IO Stream)

    4. pub.mime:addBodyPart (This step which adds the stream from step 3 to MimeData created in Step 1)
      The following are the input parameters:
      mimeData = MimeData from Step 1
      content = IO stream from Step 3
      isEnvStream = no
      contenttype = text/html
      encoding = 7bit

    5. pub.mime:addBodyPart (This step which adds the received email attachment content stream to MimeData created)
      The following are the input parameters:
      mimeData = MimeData from Step 1
      content = Received email Attachment content stream

        The content has been derived/mapped using the below procedure:
      

    5.1) pub.flow:getTransportInfo
    5.2) pub.mime:createMimeData
    input = transport/email/content
    5.3) pub.mime:getBodyPartContent
    Inputs:
    MimeData = tempMimeData from Step 5.2
    index = 1 ( This is attachment file’s index)
    Outputs:
    content

    5.4) common.javasvcs:convertByteArrayToIOStream (This service converts the output content from Step 5.3)

         isEnvStream = no
    contenttype = Content type is same as per received email
    encoding = base64
    description = Description is same as per received email
    
    1. pub.mime:envelopeStream (This step converts the MimeData into MimeStream which can be used for sending emails)

    The problem is content of Excel file is coming as Empty. Let me know if i am missing anything in the pseudo code.

    Thanks & Regards,
    Pradeep


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB