problem sned mail winth xls attachment
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   stefano_errani
Posted On:   Saturday, November 26, 2005 06:47 PM

Good day. I have an application the use JavaMail 1.3.3_01 for sending an e-mail with attachment. The attachment is an Excel file with extension xls. The program run under Windows XP and jdk 1.5.0_04. When the message is sent an error occurred. the attach sent for the class has .xl extension (without s). This is the error: 550 Error: Attachment type not allowed. File "dmx.xl" has the unacceped extension "xl". If I attach a text ascii file having xls extension the error is identical. My code is: ... String corpo = "x"; Multipart multipart = new MimeMultipart(); BodyPart   More>>

Good day.



I have an application the use JavaMail 1.3.3_01 for sending an e-mail with attachment.
The attachment is an Excel file with extension xls.
The program run under Windows XP and jdk 1.5.0_04.
When the message is sent an error occurred. the attach sent for the class has .xl extension (without s).

This is the error:

550 Error: Attachment type not allowed. File "dmx.xl" has the unacceped extension "xl".



If I attach a text ascii file having xls extension the error is identical.



My code is:

...

String corpo = "x";

Multipart multipart = new MimeMultipart();

BodyPart messageBodyPart = new MimeBodyPart();

messageBodyPart.setContent(corpo, "text/html");

multipart.addBodyPart(messageBodyPart);

messageBodyPart = new MimeBodyPart();

String sfa = "dmx.xls";

DataSource source = new FileDataSource(sfa);

messageBodyPart.setDataHandler(new DataHandler(source));

messageBodyPart.setFileName(source.getName());

multipart.addBodyPart(messageBodyPart);

message.setContent(multipart);

Transport.send(message);



I have try to print the value of MessageBodyPart.getFileName()
and the value returned is dmx.xls.



If I try use any others attchments all run correctly.

For example: if I rename the file in dmx.xlx the e-mail is sent normally.



Where is the error?



Best regards.



Stefano Errani

   <<Less

Re: problem sned mail winth xls attachment

Posted By:   stefano_errani  
Posted On:   Monday, November 28, 2005 11:07 AM

I have tried to send the same e-mail manually from my client (Eudora) and all run correctly.



Best regards.



Stefano Errani

Re: problem sned mail winth xls attachment

Posted By:   Christopher_Koenigsberg  
Posted On:   Sunday, November 27, 2005 10:14 AM

550 Error: Attachment type not allowed. File "dmx.xl" has the unacceped extension "xl".


I think that is coming from your SMTP server. Apparently (? ask your postmaster/sysadmin) it has been configured to try and guard against viruses, by rejecting certain extensions, on the suggested filename of attachments to messages it handles.

About | Sitemap | Contact