예제 #1
0
파일: sendmail.php 프로젝트: Kervinou/OBM
 public function send(SMail $mail)
 {
     $to = $mail->get_to();
     $subject = $mail->get_subject();
     
     $result = mail($to, $subject, $mail->get_content(), $mail->get_non_matching_header_lines(array('To', 'Subject')), '-f '.$mail->get_return_path());
     
     if (!$result) throw new Exception('Unable to send mail');
 }
예제 #2
0
 public function send(SMail $mail) {
   self::$mailQ[] = array('to' => $mail->get_to(), 'subject' => $mail->get_subject(), 'content' => $mail->get_content());
 }
예제 #3
0
파일: MailTest.php 프로젝트: Kervinou/OBM
 public function test_get_header_value()
 {
     $mail = new SMail($this->date);
     $mail->set_from('*****@*****.**', 'Foo Bar');
     $mail->add_to('*****@*****.**', 'John Doe');
     $mail->add_cc('*****@*****.**');
     $mail->add_cc('*****@*****.**', 'Raphael Rougeron');
     $mail->set_subject('Stop these useless meetings...');
     $this->assertEquals('John Doe <*****@*****.**>', $mail->get_to());
     $this->assertEquals('Foo Bar <*****@*****.**>', $mail->get_from());
     $this->assertEquals('jane.doe@fake.net, Raphael Rougeron <*****@*****.**>', $mail->get_cc());
     $this->assertEquals('', $mail->get_bcc());
     $this->assertEquals('Stop these useless meetings...', $mail->get_subject());
 }