/**
  * @expectedException \Tx\Mailer\Exceptions\SMTPException
  */
 public function testConnectSMTPException()
 {
     $this->smtp->setServer("localhost", "99999", null)->setAuth('none', 'none');
     $message = new Message();
     $message->setFrom('You', '*****@*****.**')->setTo('Them', '*****@*****.**')->setSubject('This is a test')->setBody('This is a test part two');
     $this->smtp->send($message);
 }
Пример #2
0
 public function testSMTP()
 {
     $this->smtp->setServer(self::SERVER, self::PORT)->setAuth(self::USER, self::PASS);
     // email, password
     $this->message->setFrom('Tom', '*****@*****.**')->setFakeFrom('heelo', '*****@*****.**')->addTo('Cloud', '*****@*****.**')->setSubject('Test SMTP ' . time())->setBody('<h1>for test</h1>')->addAttachment('host', __FILE__);
     $status = $this->smtp->send($this->message);
     $this->assertTrue($status);
     usleep(self::DELAY);
 }
Пример #3
0
 public function sendEmailBySmtp($from, $to, $subject, $body)
 {
     $this->_createSmtpClient();
     $message = new Message();
     $message->setFrom($from, $from);
     $message->setTo($to, $to);
     $message->setSubject($subject);
     $message->setBody($body);
     $this->client->send($message);
 }
Пример #4
0
 /**
  *  Send the message...
  * @return boolean
  */
 public function send()
 {
     return $this->smtp->send($this->message);
 }