on 11-19-2013 8:31 AM
Hi!
I've been trying to send an attachment which is a html file using the mail adapter. On the receiver side, I got an xml file with the html content but not the html itself. I tried to use the mail package but I did not know how to actually attach the html file. Please help!!
Regards,
Meghana
I set up a simple test scenario in PI7.3 that will be able to read an email with an attachment and then forward that attachment via another email (you could also forward it to a file adapter or any other I guess). In my scenario I had an attached XLSX spreadsheet.
You need to connect to email account and use the PayloadZipBean to unzip an attached file and use PayloadSwapBean to switch payload. I am using tghe unzip to get to the internals of a spreadsheet so you probably won't do that for your attached html file.
I found that the most important parameters where the GetAttachment sap.keyvalue = MailAttachment-1 and swap.keyName Payload-Name.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Meghana,
Map constant text/html to field Content_Type from mail package xsd.
Regards,
Pranav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Meghana,
In order to change the file name of the attachment in mail adapter, you have to write a custom adapter module to achieve it.
Below is the blog which can be used to write adapter module.
This should work perfectly for your requirement.
Regards,
Veerendra.
Check the below link.. this might be helpful...
Hi Meghana,
You can get the mail package to send attachments at SAP note 748024, it has fields Content_Disposition, Content_Description, Content_Type.
Refer the document http://scn.sap.com/docs/DOC-16015 , uses XSLT to create mail package format and more options.
Regards,
Pranav
Do you want the attachment to have the filename as <something>.html instead of maindocument.xml?
Regards
Varun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Meghana,
Aer you using the message protocol XIALL and the ContentDisposition with html?.
Check Michal Krawczyk's blog about this theme: http://scn.sap.com/community/pi-and-soa-middleware/blog/2005/11/23/xi-html-e-mails-from-the-receiver...
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Meghna
I have tested Michal's blog and it worked for me.
I was also getting the content as a xml previously because I have used the paramter as
Transform.ContentType = text/xml;charset=utf-8
As soon as I change it to text/html;charset=utf-8, the content apperead as HTML not as xml.
User | Count |
---|---|
90 | |
23 | |
11 | |
9 | |
9 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.