Created
March 1, 2019 13:28
-
-
Save cgsmith/5615dd9d2b179d741c75ed7491313df0 to your computer and use it in GitHub Desktop.
BCC Postmark Transport Issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"require": { | |
"swiftmailer/swiftmailer": "~5.2", | |
"wildbit/swiftmailer-postmark": "^2.1" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'vendor/autoload.php'; | |
$postmarkApiKey = 'YOUR KEY'; | |
$fromArray = ['you@email.com' => 'Chris Smith']; | |
$emailArray = ['email1@email.com', 'email2@email.com']; | |
$transport = new \Postmark\Transport($postmarkApiKey); | |
$mailer = new \Swift_Mailer($transport); | |
$message = new \Swift_Message(); | |
$message->setSubject('Test BCC Email') | |
->setFrom($fromArray) | |
->setBcc($emailArray) | |
->setBody('<h2>Hello recipient</h2>', 'text/html'); | |
$mailer->send($message); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
running PHP 7.2.7