简体   繁体   English

org.apache.commons.mail附件文件名编码

[英]org.apache.commons.mail attachment file name encoding

I'm using apache commons mail for sending e-mails with attachments. 我正在使用apache commons邮件发送带附件的电子邮件。 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 ok). (内容我还是看好了)。

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. 提前致谢。

I believe you have to encode it. 我相信你必须编码它。

Javamail, the core library requires this Javamail,核心库需要这个

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 org.apache.commons.mail,version = [1.3,2)-CQ5(AEM)中无法解决的问题 - org.apache.commons.mail,version=[1.3,2) — Cannot be resolved issue in CQ5(AEM) org.apache.commons.mail.MultiPartEmail发送带有空正文的电子邮件 - org.apache.commons.mail.MultiPartEmail sends email with empty body org.apache.commons.mail.util.MimeMessageParser 永远不会结束解析 - org.apache.commons.mail.util.MimeMessageParser never ends parsing 使用apache commons进行编码 - Encoding using apache commons 得到org.apache.commons.mail.EmailException使用common-mail通过Hotmail发送电子邮件 - Got org.apache.commons.mail.EmailException at using common-mail to send e-mail by Hotmail org.apache.commons.configuration.INIConfiguration:带点的节名称(句点) - org.apache.commons.configuration.INIConfiguration: section name with dot (period) 使用 Apache Commons 在 Groovy 中对图像文件进行 Base 64 编码 - Base 64 encoding an image file in Groovy using Apache Commons 如何使用org.apache.commons.logging登录到文件? - How to log to a file with org.apache.commons.logging? 文件上传期间org.apache.commons.fileupload.FileUploadBase $ IOFileUploadException - org.apache.commons.fileupload.FileUploadBase$IOFileUploadException during file upload 使用org.apache.commons.logging写日志文件 - Write log file using org.apache.commons.logging
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM