kaisellgren / mailer

Compose and send emails from Dart. Supports file attachments, HTML emails and multiple transport methods.
MIT License
166 stars 86 forks source link

fix non-ascii attachment name #207

Closed holyens closed 2 years ago

holyens commented 2 years ago

Fix the bug mentioned in issue #140. For attachments whose filename contains non-ascii characters, only _value_ in content-disposition: attachment; filename="_value_" is expected to be encoded. For example, for an attachment named 测试.zip, the Content-Disposition header should be

content-disposition: attachment; filename="=?utf-8?B?5rWL6K+VLnppcA==?="

instead of

content-disposition: =?utf-8?B?YXR0YWNobWVudDsgZmlsZW5hbWU9Iua1i+ivlS56aXAi?=

reference:RFC2183#section-2

close2 commented 2 years ago

thanks for your PR. sorry for the delay.