Add from name

This commit is contained in:
Miguel Nogueira 2019-09-15 20:27:26 +02:00
parent df77a0fb83
commit 6cf6ee1c39
1 changed files with 4 additions and 3 deletions

View File

@ -6,7 +6,7 @@ use PHPMailer\PHPMailer\Exception;
class MailWrapper class MailWrapper
{ {
private $fqm, $host, $protocol, $replyto, $from; private $fqm, $host, $protocol, $replyto, $from, $fromName;
private $recipient; private $recipient;
@ -33,7 +33,7 @@ class MailWrapper
$this->mailer->SMTPSecure = $this->protocol; $this->mailer->SMTPSecure = $this->protocol;
$this->mailer->Port = ($this->protocol == "tls") ? '587' : '465'; $this->mailer->Port = ($this->protocol == "tls") ? '587' : '465';
$this->mailer->setFrom($this->from); $this->mailer->setFrom($this->from, $this->fromName);
$this->mailer->addAddress($this->recipient); $this->mailer->addAddress($this->recipient);
$this->mailer->addReplyTo($this->replyto); $this->mailer->addReplyTo($this->replyto);
@ -55,9 +55,10 @@ class MailWrapper
/** /**
* @param mixed $from * @param mixed $from
*/ */
public function setFrom($from) public function setFrom($from, $fromName)
{ {
$this->from = $from; $this->from = $from;
$this->fromName = $fromName;
return $this; return $this;
} }