PHP code example of jpiasetz / postmark

1. Go to this page and download the library: Download jpiasetz/postmark library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jpiasetz / postmark example snippets




use Postmark\Message;
use Postmark\Mail;

// create a message
$message = new Message();
$message->setFrom('[email protected]');
$message->addTo('[email protected]');
$message->setSubject('Test');
$message->setTextBody('Hello');

// send message
$mail = new Mail('POSTMARK_API_TEST');
$mail->send($message);



use Postmark\Message;
use Postmark\Mail;

// create a message
$message = new Message();
$message->setFrom('[email protected]');
$message->addTo('[email protected]');
$message->setSubject('Test');
$message->setTextBody('Hello');

// create an array of messages you want to send
$messages = array($message, $message);

// send message
$mail = new Mail('POSTMARK_API_TEST');
$mail->batchSend($messages);