summaryrefslogtreecommitdiff
path: root/Postman/Phpmailer/PostsmtpMailer.php
diff options
context:
space:
mode:
Diffstat (limited to 'Postman/Phpmailer/PostsmtpMailer.php')
-rw-r--r--Postman/Phpmailer/PostsmtpMailer.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/Postman/Phpmailer/PostsmtpMailer.php b/Postman/Phpmailer/PostsmtpMailer.php
index 82527d2..f3e0479 100644
--- a/Postman/Phpmailer/PostsmtpMailer.php
+++ b/Postman/Phpmailer/PostsmtpMailer.php
@@ -33,13 +33,11 @@ class PostsmtpMailer extends PHPMailer {
$senderEmail = $this->options->getMessageSenderEmail();
$senderName = $this->options->getMessageSenderName();
- $this->addCustomHeader('X-Mailer', 'PostSMTP/' . POST_SMTP_VER );
-
// create a PostmanMessage instance
$message = $postmanWpMail->createNewMessage();
$message->setFrom( $senderEmail, $senderName );
- $message->addHeaders( $this->getCustomHeaders() );
+ $message->addHeaders( $this->getHeaders() );
$message->setBodyTextPart( $this->AltBody );
$message->setBodyHtmlPart( $this->Body );
$message->setBody( $this->Body );
@@ -75,6 +73,15 @@ class PostsmtpMailer extends PHPMailer {
}
+ private function getHeaders() {
+ $headers = array();
+ foreach ( $this->getCustomHeaders() as $header ) {
+ $headers[] = "{$header[0]}: {$header[1]}";
+ }
+
+ return $headers;
+ }
+
public function postman_wp_mail_result() {
$result = [
'time' => '',