Skip to content

Commit

Permalink
fixing duplicate emails being sent with MailTransport fixes #2022
Browse files Browse the repository at this point in the history
  • Loading branch information
ceeram committed Sep 29, 2011
1 parent 22029a1 commit 883f579
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/Cake/Network/Email/MailTransport.php
Expand Up @@ -44,8 +44,7 @@ public function send(CakeEmail $email) {
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);
Expand Down

0 comments on commit 883f579

Please sign in to comment.