Updated for RC1.
This commit is contained in:
parent
01aae41d74
commit
035cf12fea
@ -52,6 +52,7 @@ class Sendmail_Core {
|
|||||||
break;
|
break;
|
||||||
case "header":
|
case "header":
|
||||||
if (count($value) != 2) {
|
if (count($value) != 2) {
|
||||||
|
Kohana_Log::add("error", wordwrap("Invalid header parameters\n" . Kohana::debug($value)));
|
||||||
throw new Exception("@todo INVALID_HEADER_PARAMETERS");
|
throw new Exception("@todo INVALID_HEADER_PARAMETERS");
|
||||||
}
|
}
|
||||||
$this->headers[$value[0]] = $value[1];
|
$this->headers[$value[0]] = $value[1];
|
||||||
@ -70,6 +71,7 @@ class Sendmail_Core {
|
|||||||
|
|
||||||
public function send() {
|
public function send() {
|
||||||
if (empty($this->to)) {
|
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");
|
throw new Exception("@todo TO_IS_REQUIRED_FOR_MAIL");
|
||||||
}
|
}
|
||||||
$to = implode(", ", $this->to);
|
$to = implode(", ", $this->to);
|
||||||
@ -84,8 +86,6 @@ class Sendmail_Core {
|
|||||||
$headers = implode($this->header_separator, $headers);
|
$headers = implode($this->header_separator, $headers);
|
||||||
$message = wordwrap($this->message, $this->line_length, "\n");
|
$message = wordwrap($this->message, $this->line_length, "\n");
|
||||||
if (!$this->mail($to, $this->subject, $message, $headers)) {
|
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");
|
throw new Exception("@todo SEND_MAIL_FAILED");
|
||||||
}
|
}
|
||||||
return $this;
|
return $this;
|
||||||
@ -117,10 +117,6 @@ class Sendmail_Core {
|
|||||||
$mail->Subject = $subject;
|
$mail->Subject = $subject;
|
||||||
$mail->Body = $message;
|
$mail->Body = $message;
|
||||||
|
|
||||||
if ($mail->Send()) {
|
return $mail->Send();
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user