Reputation: 3050
I'm using apache commons mail for sending e-mails with attachments. My attachment file content is in hebrew and I can see it when I open the file , my problem is when the attachment file name is in hebrew I can't see the name I see ??? instead. (the content I still see o.k).
this is my code:
String attachment_file_name = "קובץ מס 1";
HtmlEmail email = new HtmlEmail();
email.setHostName(smtp_server);
email.addTo(to_email;
email.setFrom(from_email , "XXXXXXX");
email.setSubject(subject);
email.setCharset("UTF-8");
email.setHtmlMsg(body);
email.attach(new ByteArrayDataSource(attachment_file_.toByteArray(), "application/pdf"),
attachment_file_name ,
"attachment pdf",
EmailAttachment.ATTACHMENT);
email.send();
what do I need to do inorder to see the file name in hebrew (in the correct encoding) ?
Thank's In Advance.
Upvotes: 1
Views: 2899
Reputation: 29971
Set the System property "mail.mime.encodeparameters" to "true".
Upvotes: 0
Reputation: 9399
I believe you have to encode it.
Javamail, the core library requires this
Upvotes: 4