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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andypost’s picture

Status: Active » Needs review

If you post a patch please set status NR

erbzh’s picture

Hi,

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 :(

sun’s picture

Title: Problem with Subject encoding in Outlook » Subject not encoded for UTF-8 (garbled characters in Outlook)
Issue summary: View changes

Good 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.

rudam’s picture

the patch works! thanks

oadaeh’s picture

Assigned: Unassigned » oadaeh
Category: Bug report » Feature request
Status: Needs review » Active

I 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.

oadaeh’s picture

Assigned: oadaeh » Unassigned
Status: Active » Needs review
FileSize
2.33 KB

Patch attached for review.

oadaeh’s picture

I 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.

Anybody’s picture

Status: Needs review » Reviewed & tested by the community

Just 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.

nitrocad’s picture

I can confirm too, that this patch works with the latest version.

Anybody’s picture

@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.

Anybody’s picture

PS: If you don't have the time I'd like to offer my help as co-maintainer for this project of course.

oadaeh’s picture

Sorry 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.

Anybody’s picture

Thank you very very much, that's great news!

  • oadaeh committed 7f1b28a on 7.x-3.x
    Issue #1408226 by oadaeh, Spleshka, Anybody, erbzh, sun, rudam, nitrocad...
oadaeh’s picture

Status: Reviewed & tested by the community » Fixed

This 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. :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.