The attached patch (DRUPAL-6--1) for messaging_phpmailer.module looks in $message['headers']['From'] for formatting like:

"Mr Magoo"
'Mr Magoo'
Mr Magoo

If it finds such formatting, it will appropriately set $mail->From and $mail->FromName. If it does not find such formatting, there is no change from the current behaviour.

Note that this format may also end up being the default in D7: http://drupal.org/node/209672

CommentFileSizeAuthor
rfc2822.patch1.13 KBryan_courtnage

Comments

ryan_courtnage’s picture

whoop, those formatting examples were supposed to look like:

"Mr Magoo" <foobar@example.com>
'Mr Magoo' <foobar@example.com>
Mr Magoo <foobar@example.com>
jose reyero’s picture

Status: Needs review » Fixed

Thanks, looks good, committed with a few minor changes (to avoid php notices). Also we better don't use the same text for From and FromName, because we may get this, #366810: PHPMailer "From" header is broken

Status: Fixed » Closed (fixed)

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