PHP code example of henrikbjorn / stampie
1. Go to this page and download the library: Download henrikbjorn/stampie 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/ */
henrikbjorn / stampie example snippets
// composer autoloading.
\Message
{
public function getFrom() { return '[email protected]'; }
public function getSubject() { return 'You are trying out Stampie'; }
public function getText() { return 'So what do you think about it?'; }
}
$adapter = new Http\Adapter\Guzzle6\Client();
$mailer = new Stampie\Mailer\SendGrid($adapter, 'username:password');
// Throws an HttpException for error
// messages not recognized by SendGrid api or ApiException for known errors.
$mailer->send(new Message('[email protected]'));
bash
composer