Exemple #1
0
 protected function send($level, \org\rhaco\Log $log)
 {
     if (empty($this->template_base)) {
         $this->template_base = \org\rhaco\Conf::get('template_base', \org\rhaco\io\File::resource_path('log_mail'));
     }
     $template = \org\rhaco\net\Path::absolute($this->template_base, $level . '_log.xml');
     if (is_file($template)) {
         $mail = new \org\rhaco\net\mail\Mail();
         $mail->send_template($template, array('log' => $log, 'env' => new \org\rhaco\lang\Env()));
     }
 }
Exemple #2
0
<?php

$mail = new \org\rhaco\net\mail\Mail();
$mail->to("*****@*****.**", "abc");
$mail->to("*****@*****.**");
$mail->to("*****@*****.**", "ghi");
eq(array('*****@*****.**' => '"=?ISO-2022-JP?B?YWJj?=" <*****@*****.**>', '*****@*****.**' => '"*****@*****.**" <*****@*****.**>', '*****@*****.**' => '"=?ISO-2022-JP?B?Z2hp?=" <*****@*****.**>'), $mail->to());
$mail = new \org\rhaco\net\mail\Mail();
$mail->cc("*****@*****.**", "abc");
$mail->cc("*****@*****.**");
$mail->cc("*****@*****.**", "ghi");
eq(array('*****@*****.**' => '"=?ISO-2022-JP?B?YWJj?=" <*****@*****.**>', '*****@*****.**' => '"*****@*****.**" <*****@*****.**>', '*****@*****.**' => '"=?ISO-2022-JP?B?Z2hp?=" <*****@*****.**>'), $mail->cc());
$mail = new \org\rhaco\net\mail\Mail();
$mail->bcc("*****@*****.**", "abc");
$mail->bcc("*****@*****.**");
$mail->bcc("*****@*****.**", "ghi");
eq(array('*****@*****.**' => '"=?ISO-2022-JP?B?YWJj?=" <*****@*****.**>', '*****@*****.**' => '"*****@*****.**" <*****@*****.**>', '*****@*****.**' => '"=?ISO-2022-JP?B?Z2hp?=" <*****@*****.**>'), $mail->bcc());
$mail = new \org\rhaco\net\mail\Mail();
$mail->return_path("*****@*****.**");
$mail->return_path("*****@*****.**");
eq("*****@*****.**", $mail->return_path());
$mail = new \org\rhaco\net\mail\Mail();
$mail->subject("改行は\r\n削除される");
eq("=?ISO-2022-JP?B?GyRCMn45VCRPOm89fCQ1JGwkaxsoQg==?=", $mail->subject());
Exemple #3
0
<?php

$vars = array('abc' => 'ABC');
$mail = new \org\rhaco\net\mail\Mail();
$mail->to("*****@*****.**");
$mail->send_template('send.xml', $vars);
$xml = \org\rhaco\Dt::find_mail('*****@*****.**');
eq('ボディーテストABC' . PHP_EOL, $xml->message());
eq('テストサブジェクト', $xml->subject());
$vars = array('abc' => 'ABC');
$mail = new \org\rhaco\net\mail\Mail();
$mail->to("*****@*****.**");
$mail->send_template('send_html.xml', $vars);
$xml = \org\rhaco\Dt::find_mail('*****@*****.**');
eq('ボディーテストABC' . PHP_EOL, $xml->message());
eq('テストサブジェクト', $xml->subject());
meq('Content-Type: text/html;', $xml->manuscript());
meq('<p class="abc">ピーボディー</p>', mb_convert_encoding($xml->manuscript(), 'UTF8', 'JIS'));
meq('send_html.css', mb_convert_encoding($xml->manuscript(), 'UTF8', 'JIS'));