PHP code example of rcastera / mailer
1. Go to this page and download the library: Download rcastera/mailer 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/ */
rcastera / mailer example snippets
use rcastera\Email\Mailer;
$mailer = new Mailer();
castera\Email\Mailer;
$mailer = new Mailer();
$mailer = new Mailer();
$mailer->priority(3); // 1 for urgent, 3 for normal.
$mailer->to(array('[email protected]'));
$mailer->cc(array('[email protected]'));
$mailer->bcc(array('[email protected]'));
$mailer->from('John Doe', '[email protected]');
$mailer->subject('This is a test!');
$mailer->body('Hi this is the body of the email.');
$mailer->attach(array('example.zip'));
if ($mailer->send()) {
echo('Email sent!');
} else {
echo('Error sending Email!');
}
unset($mailer);