Pop\Mail\Mail::replyTo PHP Method

replyTo() public method

Alias to set the reply-to and from headers
public replyTo ( string $email, string $name = null, boolean $from = true ) : Mail
$email string
$name string
$from boolean
return Mail
    public function replyTo($email, $name = null, $from = true)
    {
        $header = null !== $name ? $name . ' <' . $email . '>' : $email;
        $this->setHeader('Reply-To', $header);
        if ($from) {
            $this->setHeader('From', $header);
        }
        return $this;
    }

Usage Example

コード例 #1
0
ファイル: MailTest.php プロジェクト: nicksagona/PopPHP
 public function testSetAndGetHeaders()
 {
     $m = new Mail();
     $m->setHeader('X-Reply-To', '*****@*****.**');
     $m->setHeader('X-Reply-To', 'Bob <*****@*****.**>');
     $m->replyTo('*****@*****.**');
     $m->setHeaders(array('Reply' => '*****@*****.**'));
     $m->setParams(' -i');
     $m->setParams(array(' -t'));
     $m->setParams();
     $this->assertEquals('*****@*****.**', $m->getHeader('Reply-To'));
     $this->assertEquals(4, count($m->getHeaders()));
 }
All Usage Examples Of Pop\Mail\Mail::replyTo