Skip to content

Instantly share code, notes, and snippets.

@cgsmith
Created March 1, 2019 13:28
Show Gist options
  • Select an option

  • Save cgsmith/5615dd9d2b179d741c75ed7491313df0 to your computer and use it in GitHub Desktop.

Select an option

Save cgsmith/5615dd9d2b179d741c75ed7491313df0 to your computer and use it in GitHub Desktop.
BCC Postmark Transport Issue
{
"require": {
"swiftmailer/swiftmailer": "~5.2",
"wildbit/swiftmailer-postmark": "^2.1"
}
}
<?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);
@cgsmith

cgsmith commented Mar 1, 2019

Copy link
Copy Markdown
Author

running PHP 7.2.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment