on 08-08-2006 11:11 AM
Hi,
I want to send a excel file as attachment in mail Adapter.i am using an Adapter Module.Inside my module i use the following code snippet to add the attachmnet.
*********************************
attachment.setName("Attachment");
attachment.setContentType("application/vnd.ms-excel");
String temp = "sriram:\thi\n\nsudharshan:\thowz life";
attachment.setContent(temp.getBytes());
msg.addAttachment(attachment);
*********************************
The problem is that though i have set the Content type for xls, still I am getting the attachment with extension .bin.How to get the extension as xls.
Also an extra file(payload)comes along with the attachment.How to avoid this extra file.
Thanks in advance.
Regards,
Sudharshan
Hi Sudharshan,
You could also look at the MessageTransformBean and PayloadSwapbean.
http://help.sap.com/saphelp_erp2005/helpdata/en/57/0b2c4142aef623e10000000a155106/frameset.htm -- MessageTransformBean
http://help.sap.com/saphelp_erp2005/helpdata/en/2e/bf37423cf7ab04e10000000a1550b0/frameset.htm -- PayloadSwapBean
cheers,
Prashanth
P.S Please mark helpful answers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sudharshan,
Does the attachment come through properly? You could check that by changing the attachment name(once u recieve it), to .xls and open it with MS-Excel.
Once you are sure that the excel file is coming through properly, then you can try changing the MIME content.
cheers,
Prashanth
P.S please mark helpful answers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
When I save that attachment as .xls I am able to get proper Excel file.
Only hitch is the extension of the attachment. Hence the recepient is not able to open the attachment and is forced to save it as .xls and check the contents.
Note: Additional attachment that comes by default for payload has been removed by Message Transformation Bean.
Thanks.
Regards,
Sudharshan
Hi All,
Problem is solved.
Sequence of steps:
1.PayloadSwapBean: To swap Payload and attachment.
2.Message Transformation Bean: To send the Payload as attachment with required content type(In my case xls).
3.In Parameters of channel- Without Mail Package and make sure keep attachments check box is unchecked.
Thank u all for ur efforts.
Regards,
Sudharshan
HI sudhersan,
I have a scenario like same as yours. File to Mail with external attachment. i have file adapter pick up the file from source directory and send as email. what i need is i have another .pdf file in my local drive i have to pick up from local drive and attached to that mail as .pdf. could you please help me this one.
thank you
Regards
Sundher
Hi,
Did you have a look at these blogs,
/people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
/people/sravya.talanki2/blog/2006/01/12/xi-triggering-e-mails-with-multiple-attachments--problems
Regards,
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bhavesh,
I have gone through the blogs.
I want to send mail using Mail Adapter only.
The problem is that i have to construct an Excel File(.xls) out of my payload and send it as attachment in the mail. The problem is that though i am able to send the attachment,the extension is not correct as specified in Content type(MIME).
Any thoughts?
Thanks.
Regards,
Sudharshan
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.