Pop\Mail\Mail::from PHP Method

from() public method

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

Usage Example

Ejemplo n.º 1
0
 public function testFrom()
 {
     $m = new Mail('Subject');
     $m->from('*****@*****.**', 'Bob Smith');
     $this->assertEquals('Bob Smith <*****@*****.**>', $m->getHeader('From'));
     $this->assertEquals('Bob Smith <*****@*****.**>', $m->getHeader('Reply-To'));
 }
All Usage Examples Of Pop\Mail\Mail::from