Skip to content

Commit

Permalink
Added method to set Sender Email
Browse files Browse the repository at this point in the history
  • Loading branch information
pinceladasdaweb committed Nov 19, 2016
1 parent ba9a8b6 commit 638ed29
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions process.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
$mail->setTo($config->get('emails.to'));
$mail->setFrom($config->get('emails.from'));
$mail->setSender($name);
$mail->setSenderEmail($email);
$mail->setSubject($config->get('subject.prefix') . ' ' . $subject);

$body = "
Expand Down
10 changes: 8 additions & 2 deletions vendor/SimpleMail/SimpleMail.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class SimpleMail
protected $to;
protected $from;
protected $sender;
protected $sender_email;
protected $subject;
protected $html;

Expand All @@ -33,6 +34,11 @@ public function setSender($sender)
$this->sender = $sender;
}

public function setSenderEmail($sender_email)
{
$this->sender_email = $sender_email;
}

public function setSubject($subject)
{
$this->subject = $subject;
Expand All @@ -50,8 +56,8 @@ public function send()
$header = 'MIME-Version: 1.0' . PHP_EOL;
$header .= 'To: <' . $this->to . '>' . PHP_EOL;
$header .= 'Date: ' . date('D, d M Y H:i:s O') . PHP_EOL;
$header .= 'From: =?UTF-8?B?' . base64_encode($this->sender) . '?= <' . $this->from . '>' . PHP_EOL;
$header .= 'Reply-To: =?UTF-8?B?' . base64_encode($this->sender) . '?= <' . $this->from . '>' . PHP_EOL;
$header .= 'From: =?UTF-8?B?' . base64_encode($this->sender) . '?= <' . $this->sender_email . '>' . PHP_EOL;
$header .= 'Reply-To: =?UTF-8?B?' . base64_encode($this->sender) . '?= <' . $this->sender_email . '>' . PHP_EOL;
$header .= 'Return-Path: ' . $this->from . PHP_EOL;
$header .= 'X-Mailer: PHP/' . phpversion() . PHP_EOL;
$header .= 'X-Priority: 3' . PHP_EOL;
Expand Down

0 comments on commit 638ed29

Please sign in to comment.