PHP Classes

File: testMail.php

Recommend this page to a friend!
  Classes of Chris Thorne   Template Emailer   testMail.php   Download  
File: testMail.php
Role: Example script
Content type: text/plain
Description: Code wanting to send the email
Class: Template Emailer
Compose and send message using templates
Author: By
Last change:
Date: 15 years ago
Size: 746 bytes
 

Contents

Class file image Download
<?php
@include_once("./templateMail.class.php");

try
{
 
$templateData[]=array("master_placeholder", "master");
 
$templateData[]=array("blaster_placeholder", "blaster");
 
$template = "exampletemplate.htm";

 
$mail = new TemplateMail();
 
$mail->FromName = "Test Name";
 
$mail->From = "test@test.com";
 
$mail->Subject = "This is merely a test";
 
$mail->AddAddress("test@test.com","Test Name");
   
$mail->AddAddress("test2@test2.com","Test Name2");
   
$mail->AddAddress("test3@test3.com");
   
$mail->AddCC("test@test.com","Test Name");
 
$mail->AddBCC("test@test.com","Test Name");

 
$mail->sendTemplateEmail($templateData,$template);
}

//catch exception
catch(Exception $e)
{
 echo
'Message: ' .$e->getMessage();
}
?>