Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi! Thanks for the great module.
I found one bug there. When I used PhpMailer with MimeMail module I had a trouble with subject encoding in Outlook. It wasn's converted to UTF-8 and I saw subject in unreadable encoding. I attached a patch that fix this problem.
Comment | File | Size | Author |
---|---|---|---|
#7 | utf-8-encode-headers-1408226-7.patch | 2.11 KB | oadaeh |
| |||
phpmailer.patch | 607 bytes | Spleshka | |
Comments
Comment #1
andypostIf you post a patch please set status NR
Comment #2
erbzh CreditAttribution: erbzh commentedHi,
I also had an encoding problem for accented characters in the subject of emails (not just under Outlook) on some websites running PHPMailer + Mail System/Mime Mail/Simplenews.
For mime emails, the message subject needs to be [somewhere] passed through mime_header_encode() and this workaround solves this problem, at this time without side effects.
However I do not know exactly at which level this encoding must/should be performed.
(i.e. is this should be done by PHPMailer, or by Mime Mail, or by other modules such Simplenews?)
This has to be checked because header values must be encoded once but not twice and there are issues that are being discussed about other header elements encoding (especially sender/recipients names).
For instance :
Not so trivial at last :(
Comment #3
sunGood point, @erbzh.
I'd assume that encoding is always the responsibility of the mail engine; i.e., the phpmailer module.
However, we definitely need to double-check whether e.g. the Mail System module encodes already, and whether individual modules (like Simplenews) encode already.
At the very least, the main entry point
drupal_mail()
accepts raw/unencoded data, so I'd consider at least Simplenews's premature encoding as bogus.Comment #4
rudam CreditAttribution: rudam commentedthe patch works! thanks
Comment #5
oadaeh CreditAttribution: oadaeh at Hook 42 commentedI kept reading this thread and the linked threads in @erbzh's post, not really sure if I should do anything about it or not. I finally decided I would combine @Spleshka's patch with @sgabe's recommendation for Mime Mail in #1209018-8: From: in headers not properly encoded and add in and add an configuration setting to allow for explicitly en/disabling the functionality. I will post a patch for review momentarily.
Comment #6
oadaeh CreditAttribution: oadaeh at Hook 42 commentedPatch attached for review.
Comment #7
oadaeh CreditAttribution: oadaeh at Hook 42 commentedI was getting ready to commit the patch I created and in took one last look and realized the test on the return of preg_match() was wrong. So, here's another patch that fixes that and makes the code a little cleaner.
Comment #8
AnybodyJust tested #7 successfully. Before it was not working, now it works. Setting RTBC. Could you please create a new dev release perhaps with an update.php message? I think this is an important feature.
Comment #9
nitrocad CreditAttribution: nitrocad commentedI can confirm too, that this patch works with the latest version.
Comment #10
Anybody@Maintainer: Could you please create a new (stable) release containing this patch? It works and the problem is quite huge for non-english e.g. German projects.
Patch works perfectly in production since a month.
Comment #11
AnybodyPS: If you don't have the time I'd like to offer my help as co-maintainer for this project of course.
Comment #12
oadaeh CreditAttribution: oadaeh at Hook 42 commentedSorry for the delay on this, but due to the nature of the change, I wanted to make sure I gave ample opportunity for people to complain if the change broke something. I will endeavor to get a tagged release out in the next week or so.
Comment #13
AnybodyThank you very very much, that's great news!
Comment #15
oadaeh CreditAttribution: oadaeh at Hook 42 commentedThis has been committed and a tagged 7.x-3.0-beta4 release has been created: https://www.drupal.org/project/phpmailer/releases/7.x-3.0-beta4
Sorry again for the delay. Between surgery and extra work, I was delayed, but it's there now. :)