Location: PHPKode > scripts > dSendMail2 > dsendmail2-2-0/example-HTMLTemplate.php
require_once "dSendMail2.inc.php";

// First of all: DISABLE TIME LIMIT and IGNORE USER ABORT! You really don't want to be interrupted in the middle of this.

// Ok, let's say all your e-mails have a default header and a footer.
// So, you may re-write your "mail()" function...
function myMail($to, $subject, $message){
	$m = new dSendMail2;
	$myTemplate = dirname(__FILE__)."/mail_template.html");
	$m->setHTMLFile($myTemplate); // Automatically import HTML and ALL IMAGES USED.
	// Your message doesn't come in HTML format?!
	$message = nl2br($message);
	// You can replace your message here:
	$m->html = str_replace("[MESSAGE]", $message, $m->html);
	return $m->send();

// Then...
	"Thanks for contacting us...",
	"We received your message and will reply you as soon as we can.\r\n".
	"Thanks and come back later!"
Return current item: dSendMail2