3 //error_reporting(E_ALL);
4 error_reporting(E_STRICT);
7 date_default_timezone_set('America/Toronto');
8 //date_default_timezone_set(date_default_timezone_get());
10 include_once('class.phpmailer.php');
12 $mail = new PHPMailer();
13 $body = $mail->getFile('contents.html');
14 $body = eregi_replace("[\]",'',$body);
16 $mail->IsSendmail(); // telling the class to use SendMail transport
18 $mail->From = "name@yourdomain.com";
19 $mail->FromName = "First Last";
21 $mail->Subject = "PHPMailer Test Subject via smtp";
23 $mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
25 $mail->MsgHTML($body);
27 $mail->AddAddress("whoto@otherdomain.com", "John Doe");
29 $mail->AddAttachment("images/phpmailer.gif"); // attachment
32 echo "Mailer Error: " . $mail->ErrorInfo;