Opened 11 years ago
Closed 10 months ago
#31775 closed enhancement (worksforme)
wp_mail attachments support only ascii symbols
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 4.1.1 |
| Component: | Keywords: | ||
| Focuses: | Cc: |
Description (last modified by )
Hi.
Currently wp_mail() passes it's attachments directly to PHPMailer, and that results in taking file basename as attachment name. Basename seems to behave not normal on non-ascii symbols, for example /сontacts.png (the first 'c' is russian) will be truncated as ontacts.png. Apart from that, even if it would be basename'd correctly, it won't be utf8-encoded as required by standard (=?utf-8?B?base64?=), and that will probably result in broken mails and/or rejected mails.
So i'm proposing to implement functionality for manual attachment naming and/or automatic basenaming filenames and encoding attachment names according to standard.
#28407 is tightly bound to this request.
Change History (4)
#4
@
10 months ago
- Resolution set to worksforme
- Status changed from new to closed
Reproduction Report
Description
❌ This report can't validate that the issue can be reproduced.
Environment
- WordPress: 6.9-alpha-60093-src
- PHP: 8.2.29
- Server: nginx/1.29.0
- Database: mysqli (Server: 8.4.6 / Client: mysqlnd 8.2.29)
- Browser: Chrome 138.0.0.0
- OS: Windows 10/11
- Theme: Twenty Twenty-Five 1.3
- MU Plugins: None activated
- Plugins:
- Testing Dolly
- Test Reports 1.2.0
Testing Instructions
- Create a PDF name:
сontacts.pdf(like in the OP Example) - Use the 5th parameter of
wp_mailto attach this file - ✅ Attachment goes through perfectly.
- Other filenames tests:
✅ 你好.pdf
✅ emoji-📄.pdf
✅ áéíóú.pdf
Actual Results
- ❌ Error condition not occurring.
Additional Notes
- Given that this is not reproducible anymore, because the PHPMailer library's
addAttachmentmethod was updated to support more encodings 6 years ago, this is not reproducible anymore. For this reason, I'm closing this asworksforme
Would resolving #28407 resolve this?