12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- namespace Monolog\Handler;
- use Monolog\Logger;
- class NativeMailerHandler extends MailHandler
- {
- protected $to;
- protected $subject;
- protected $headers;
-
- public function __construct($to, $subject, $from, $level = Logger::ERROR, $bubble = true)
- {
- parent::__construct($level, $bubble);
- $this->to = $to;
- $this->subject = $subject;
- $this->headers = sprintf("From: %s\r\nContent-type: text/plain; charset=utf-8\r\n", $from);
- }
-
- protected function send($content)
- {
- mail($this->to, $this->subject, wordwrap($content, 120), $this->headers);
- }
- }
|