fixing duplicate emails being sent with MailTransport fixes #2022

This commit is contained in:
Ceeram 2011-09-29 14:01:26 +02:00
parent 22029a1199
commit 883f579670

View file

@ -44,8 +44,7 @@ class MailTransport extends AbstractTransport {
if (!@mail($to, $email->subject(), $message, $headers)) { if (!@mail($to, $email->subject(), $message, $headers)) {
throw new SocketException(__d('cake', 'Could not send email.')); throw new SocketException(__d('cake', 'Could not send email.'));
} }
} } elseif (!@mail($to, $email->subject(), $message, $headers, $this->_config['additionalParameters'])) {
if(!@mail($to, $email->subject(), $message, $headers, $this->_config['additionalParameters'])) {
throw new SocketException(__d('cake', 'Could not send email.')); throw new SocketException(__d('cake', 'Could not send email.'));
} }
return array('headers' => $headers, 'message' => $message); return array('headers' => $headers, 'message' => $message);