From 6cf6ee1c397054645e6827f915e9adf85cbd4eb8 Mon Sep 17 00:00:00 2001 From: miguel456 Date: Sun, 15 Sep 2019 20:27:26 +0200 Subject: [PATCH] Add from name --- src/MailWrapper.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/MailWrapper.php b/src/MailWrapper.php index ca9ff02..17e9d7d 100644 --- a/src/MailWrapper.php +++ b/src/MailWrapper.php @@ -6,7 +6,7 @@ use PHPMailer\PHPMailer\Exception; class MailWrapper { - private $fqm, $host, $protocol, $replyto, $from; + private $fqm, $host, $protocol, $replyto, $from, $fromName; private $recipient; @@ -33,7 +33,7 @@ class MailWrapper $this->mailer->SMTPSecure = $this->protocol; $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->addReplyTo($this->replyto); @@ -55,9 +55,10 @@ class MailWrapper /** * @param mixed $from */ - public function setFrom($from) + public function setFrom($from, $fromName) { $this->from = $from; + $this->fromName = $fromName; return $this; }