diff --git a/smtp.mail.inc b/smtp.mail.inc index b064330..dd7ccad 100644 --- a/smtp.mail.inc +++ b/smtp.mail.inc @@ -165,9 +165,10 @@ class SmtpMailSystem implements MailSystemInterface { } // Defines the From value to what we expect. - $mailer->From = $from_comp['email']; - $mailer->FromName = empty($from_comp['name']) ? $from_name : $from_comp['name']; - $mailer->Sender = $from_comp['email']; + $mailer->From = $from_comp['email']; + $mailer->FromName = $from_comp['name']; + $headers['From'] = $from; + $headers['Sender'] = $headers['Return-Path'] = $from_comp['email']; // Create the list of 'To:' recipients. @@ -183,18 +184,6 @@ class SmtpMailSystem implements MailSystemInterface { foreach ($headers as $key => $value) { //watchdog('error', 'Key: ' . $key . ' Value: ' . $value); switch (drupal_strtolower($key)) { - case 'from': - if ($from == NULL or $from == '') { - // If a from value was already given, then set based on header. - // Should be the most common situation since drupal_mail moves the - // from to headers. - $from = $value; - $mailer->From = $value; - // then from can be out of sync with from_name ! - $mailer->FromName = ''; - $mailer->Sender = $value; - } - break; case 'content-type': // Parse several values on the Content-type header, storing them in an array like // key=value -> $vars['key']='value'