예제 #1
0
<?php

$mail = new \ebi\Mail();
$mail->from('*****@*****.**');
$mail->to('*****@*****.**');
$mail->send('subject', 'body');
$dao = \ebi\SmtpBlackholeDao::find_get(\ebi\Q::order('-id'));
eq('subject', $dao->subject());
eq('body', $dao->message());
eq('*****@*****.**', $dao->to());
예제 #2
0
파일: Dt.php 프로젝트: tokushima/ebi
 /**
  * SmtpBlackholeDaoから送信されたメールの一番新しいものを返す
  * @param string $to
  * @param string $tcode
  * @param string $keyword
  * @return \ebi\SmtpBlackholeDao
  */
 public static function find_mail($to, $tcode = '', $keyword = '')
 {
     $q = new Q();
     $q->add(Q::eq('to', $to));
     $q->add(Q::gte('create_date', time() - 300));
     if (!empty($tcode)) {
         $q->add(Q::eq('tcode', $tcode));
     }
     foreach (\ebi\SmtpBlackholeDao::find($q, Q::order('-id')) as $mail) {
         $value = $mail->subject() . $mail->message();
         if (empty($keyword) || mb_strpos($value, $keyword) !== false) {
             return $mail;
         }
     }
     throw new \ebi\exception\NotFoundException('mail not found');
 }