Fork Me on GitHub


Handle text/HTML email creation and sending WITH GREAT EASE

download .ZIPdownload .TGZ

I made this myself!

It's the first script I'm releasing publicly, and though many others have released their own versions of Mail Sending classes, I thought I'd give it a go. So, here I am.

Quick Example

Here's how I envisioned this being used.

// Set up CSS
$css = <<<CSS_FILE
h1 { font-family:Georgia,serif; font-size:24px; font-weight:normal; }
h2 { font-family:Georgia,serif; font-size:20px; font-weight:normal; }
p { font-family:Verdana,sans-serif; font-size:16px; }


// Set up email parameters
$send = new SendMail( MSG_HTML + MSG_TXT );
$send->setSender ( $_POST['contactname'] , $_POST['contactemail'] );
$send->setReceiver ('Jason','');
$send->addBCC ('Facebook','');
$send->subject = "This is the email subject";
$send->css = $css;

// Load message from file, and set reparse file to include actual name
// whenever {$name} appears in the file
$html_message = $send->GetEmailFromFile ('thankyou.html');
$txt_message = $send->GetEmailFromFile ('thankyou.txt');

$send->text_message = $send->reparseMail ( $txt_message , array (
    'name' = > $_POST['contactname'] ) );
$send->html_message = $send->reparseMail ( $html_message , array (
    'name' = > $_POST['contactname'] ) );

// Actually send the email
$result = $send->send();

if ($result == TRUE) {
    echo "Achievement Unlocked: You have sent an email! (10gp)";
} else {
    echo "Utter failure. You lose! Good day, sir!";

Teux-deux list.

(Yes I know, teuxdeux is already a website)

Authors and Contributors

So far, it's just me. You know, @jvjvjv.

Support or Contact

If you have any issues using this, or suggestions to make this better, please let me know,