From 883f5796707b90da2aa86c5b256fc21c4d781c21 Mon Sep 17 00:00:00 2001 From: Ceeram Date: Thu, 29 Sep 2011 14:01:26 +0200 Subject: [PATCH] fixing duplicate emails being sent with MailTransport fixes #2022 --- lib/Cake/Network/Email/MailTransport.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/Cake/Network/Email/MailTransport.php b/lib/Cake/Network/Email/MailTransport.php index d90385a0e..c1682626e 100644 --- a/lib/Cake/Network/Email/MailTransport.php +++ b/lib/Cake/Network/Email/MailTransport.php @@ -44,8 +44,7 @@ class MailTransport extends AbstractTransport { if (!@mail($to, $email->subject(), $message, $headers)) { throw new SocketException(__d('cake', 'Could not send email.')); } - } - if(!@mail($to, $email->subject(), $message, $headers, $this->_config['additionalParameters'])) { + } elseif (!@mail($to, $email->subject(), $message, $headers, $this->_config['additionalParameters'])) { throw new SocketException(__d('cake', 'Could not send email.')); } return array('headers' => $headers, 'message' => $message);