Skip to content

Commit

Permalink
Updated for RC1.
Browse files Browse the repository at this point in the history
  • Loading branch information
rWatcher committed Feb 25, 2010
1 parent 01aae41 commit 035cf12
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions modules/phpmailer/libraries/Sendmail.php
Expand Up @@ -52,6 +52,7 @@ public function __call($key, $value) {
break;
case "header":
if (count($value) != 2) {
Kohana_Log::add("error", wordwrap("Invalid header parameters\n" . Kohana::debug($value)));
throw new Exception("@todo INVALID_HEADER_PARAMETERS");
}
$this->headers[$value[0]] = $value[1];
Expand All @@ -70,6 +71,7 @@ public function __call($key, $value) {

public function send() {
if (empty($this->to)) {
Kohana_Log::add("error", wordwrap("Sending mail failed:\nNo to address specified"));
throw new Exception("@todo TO_IS_REQUIRED_FOR_MAIL");
}
$to = implode(", ", $this->to);
Expand All @@ -84,8 +86,6 @@ public function send() {
$headers = implode($this->header_separator, $headers);
$message = wordwrap($this->message, $this->line_length, "\n");
if (!$this->mail($to, $this->subject, $message, $headers)) {
Kohana::log("error", wordwrap("Sending mail failed:\nTo: $to\n $this->subject\n" .
"Headers: $headers\n $this->message"));
throw new Exception("@todo SEND_MAIL_FAILED");
}
return $this;
Expand Down Expand Up @@ -117,10 +117,6 @@ public function mail($to, $subject, $message, $headers) {
$mail->Subject = $subject;
$mail->Body = $message;

if ($mail->Send()) {
return true;
} else {
return false;
}
return $mail->Send();
}
}
}

0 comments on commit 035cf12

Please sign in to comment.