Has work started to port this to d7 yet? If not, I might need this functionality on a project I'm working on and could help with the port.

Members fund testing for the Drupal project. Drupal Association Learn more


elliotttf’s picture

Version: 6.x-3.x-dev » 6.x-2.x-dev
12.22 KB

Here's a first crack at this. There's still a lot of work that needs to be done, but I have confirmed that this works for normal mail (didn't try mime mail).

Also, I had issues getting the libraries to load correctly using the dev version of libraries API (might just have been user error) so I patched this from the 2.x branch.

sun’s picture

Title: port to d7 » Port to D7
Version: 6.x-2.x-dev » 7.x-3.x-dev
Category: feature » task
Status: Active » Needs review
18.8 KB

Hey, good start!

Attached patch makes the module basics work. I didn't review the class changes in detail though. I have the impression that it might be duplicating some code that actually lives elsewhere in the class already, but again, didn't carefully review that, so I might be wrong.

podarok’s picture

Status: Needs review » Closed (duplicate)


podarok’s picture

Status: Closed (duplicate) » Needs review

sorry, my mistake - wrong thread

sun’s picture

11.5 KB

#1018226: PHPMailer is currently disabled. Unable to send email has been marked as duplicate. Attached patch is a cleaned up version from @Michael Lopez' patch. Mainly for reference, the usage of static methods doesn't look right.

sun’s picture

17.54 KB

Attached patch is the same as #2 with some very minor clean-ups/reverts.

sun’s picture

Status: Needs review » Needs work
24.3 KB

Committed attached patch to 7.x-3.x.

Didn't look into MimeMail integration yet. MimeMail seems to contain major changes between D6 and D7.

InternetDevels’s picture

Notice: Undefined index: sender in mimemail_phpmailer_send() (line 28 of /path/to/site/sites/all/modules/phpmailer/includes/phpmailer.mimemail.inc).
Notice: Undefined index: address in mimemail_phpmailer_send() (line 36 of /path/to/site/sites/all/modules/phpmailer/includes/phpmailer.mimemail.inc).
Module tries to use $message['sender'] and $message['address'] variables instead of $message['from'] and $message['to']. Fixed in patch.

sun’s picture

Thanks, @InternetDevels.Com -- committed #8 including an E_STRICT warning fix to 7.x-3.x.

Does the MimeMail integration fully work already?

oadaeh’s picture

Status: Needs work » Needs review
1.58 KB

I'm going to chime in here, as it seems to be the correct place.

I've created a patch to make PHPMailer work with Mime Mail.

In it are these changes:

  • Adds a 'list' $op to phpmailer_mailengine(), which is an array containing the name and description. I left the 'name' and 'description' $ops as I don't know for sure that they aren't used (but I suspect not).
  • Removes a check for the 'class.pop3.php' file in phpmailer_registry_files_alter() and phpmailer_library_exists(). That class does not appear to be used, and the file is not mentioned as part of the installation procedures in the README.txt file.
  • Removed the "$exists &&" part of the check in phpmailer_library_exists(), as that caused the check to always return FALSE, even when TRUE.
oadaeh’s picture

I just found #1072418: Mimemail's hook_mailengine() return value has changed (I guess Drupal's search doesn't return words with the search term embedded in them -- I thought it did), which is a patch for handling the 'list' $op. I can recreate my patch, removing that part, if desired.

Kars-T’s picture

1.63 KB

+1 for the patch in #8. Works with mimemail.

One minor change: As far as I see in the mimemail module we can remove "name" and "description" from hook_mailengine(). This is replaced by "list".

marcusx’s picture

+1 for the patch in #12. Works with mimemail.

I also used the latest phpMailer Version 5.2.0 from
which seems to work ok.

(last tested version was 5.0.2)

is the information on the project page...

smk-ka’s picture

Status: Needs review » Fixed

Thanks for confirming! Committed #12 to 7.x-3.x.

Status: Fixed » Closed (fixed)

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

anrikun’s picture

Status: Closed (fixed) » Active

Is any official release planned?

oadaeh’s picture

Issue summary: View changes
Status: Active » Closed (fixed)

There is a Drupal 7 port. Discussion about an official release can be continued on #2297403: Plan for PHPMailer 7.x stable release
I'm restoring the status.