PHP code example of kurtiz / email-man
1. Go to this page and download the library: Download kurtiz/email-man 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/ */
kurtiz / email-man example snippets
use EmailMan\EmailMan;
add recipients
$email->addto("[email protected]");
$email->addto("[email protected]", "Test 2");
$email->addto("[email protected]");
// add cc
$email->addCC("[email protected]");
$email->addCC("[email protected]");
// add bcc
$email->addBCC("[email protected]");
// set sender email
$email->setFrom("[email protected]");
// set sender name
$email->setFromName("Sender Name");
// set subject
$email->setSubject("THIS IS THE SUBJECT OF THE EMAIL");
// set message
$email->setMessage("This is just a test message");
// set reply to
$email->setReplyTo("[email protected]");
// prepare the headers
$email->prepareHeaders();
// send the email
$email->send();
// dump errors if there are any
$errors = $email->dumpDebugger();
echo "<pre>";
var_dump($errors);
echo "</pre>";