Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for non-English attachment names #58

Closed
ensean opened this issue Dec 14, 2016 · 5 comments
Closed

Add support for non-English attachment names #58

ensean opened this issue Dec 14, 2016 · 5 comments
Milestone

Comments

@ensean
Copy link

ensean commented Dec 14, 2016

I meet a problem that while using this tool to send attachments with non-English name, it seems that the receiver's mail server can not decode the attachment name correctly. Detailed info is as follows:

Please note that the base64 data of the attachments are omit

  • eml generated by this tool
------=_Part_0_1135323183.1481683823991
Content-Type: application/octet-stream; filename=ODS
簸?.docx; name=ODS
簸?
Content-Transfer-Encoding: base64
Content-Disposition: attachment; size=0; 
	filename*=utf-8''ODS%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%BB%B4%E6%8A%A4%E8%AF%B4%E6%98%8E.docx
Content-ID: <ODS
簸?>

------=_Part_0_1135323183.1481683823991
Content-Type: application/octet-stream; filename=CP?燒?.xlsx; name=CP?燒?
Content-Transfer-Encoding: base64
Content-Disposition: attachment; size=0; 
	filename*=utf-8''%E6%9D%83%E9%99%90%E6%8E%A7%E5%88%B6%E5%8A%9F%E8%83%BD%E8%AF%B4%E6%98%8E.xlsx
Content-ID: <CP?燒?>

------=_Part_0_1135323183.1481683823991
Content-Type: application/octet-stream; filename=�披��(?.txt; name=�披��(?
Content-Transfer-Encoding: base64
Content-Disposition: attachment; size=0; 
	filename*=utf-8''%E3%80%90%E5%BF%85%E8%AF%BB%E3%80%91%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E.txt
Content-ID: <�披��(?>
  • eml generated by the sender mail server(send mail to server by the web client of the sender's server, the receiver's server can decode the attachment correctly)
------=_Part_68043_345475145.1481684426317
Content-Type: application/octet-stream;
 name="=?GBK?Q?ODS=B7=FE=CE=F1=C6=F7=CE=AC=BB=A4=CB=B5=C3=F7.docx?="
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="=?GBK?Q?ODS=B7=FE=CE=F1=C6=F7=CE=AC=BB=A4=CB=B5=C3=F7.docx?="

------=_Part_68043_345475145.1481684426317
Content-Type: application/octet-stream;
 name="=?GBK?B?yKjP3r/Y1sa5psTcy7XD9y54bHN4?="
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="=?GBK?B?yKjP3r/Y1sa5psTcy7XD9y54bHN4?="

------=_Part_68043_345475145.1481684426317
Content-Type: application/octet-stream;
 name="=?GBK?B?ob6x2LbBob/KudPDy7XD9y50eHQ=?="
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="=?GBK?B?ob6x2LbBob/KudPDy7XD9y50eHQ=?="

So, is it possible the set the encoding method for the attachment name ?

@ensean
Copy link
Author

ensean commented Dec 19, 2016

I find a work around as follows...

mail.addAttachment(MimeUtility.encodeText(attachmentName), new FileDataSource(attachmentPath))

@ensean ensean closed this as completed Dec 19, 2016
@bbottema
Copy link
Owner

I've seen your issue and I still intend to fix it on my side as well...

@bbottema
Copy link
Owner

Will be solved in v4.1.3

@bbottema bbottema added this to the 4.1.3 milestone Jan 28, 2017
@bbottema bbottema changed the title adding support for specifying encoding for non-English attachment name ? Add support for non-English attachment names Jan 28, 2017
@bbottema
Copy link
Owner

Released in 4.1.3.

@ensean
Copy link
Author

ensean commented Feb 2, 2017

Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants