public function testTo() { $m = new Mail('Subject'); $m->to('*****@*****.**', 'Bob Smith'); $m->add('*****@*****.**', 'Bubba Smith'); $m->sendAsGroup(true); $this->assertEquals(2, count($m->getQueue())); }
<?php require_once '../../bootstrap.php'; use Pop\Mail\Mail; try { $rcpts = array(array('name' => 'Test Smith', 'email' => '*****@*****.**'), array('name' => 'Someone Else', 'email' => '*****@*****.**')); $mail = new Mail('Hello World!', $rcpts); $mail->sendAsGroup(true)->from('*****@*****.**', 'Bob')->setHeaders(array('X-Mailer' => 'PHP/' . phpversion(), 'X-Priority' => '3')); $mail->setText("Hello,\n\nI'm just trying out this new Pop Mail component.\n\nThanks,\nBob\n\n"); $mail->send(); echo 'Mail Sent!'; } catch (\Exception $e) { echo $e->getMessage(); }