3 //error_reporting(E_ALL);
4 error_reporting(E_STRICT);
6 date_default_timezone_set('America/Toronto');
7 //date_default_timezone_set(date_default_timezone_get());
9 include_once('class.phpmailer.php');
10 //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
12 $mail = new PHPMailer();
14 $body = $mail->getFile('contents.html');
15 $body = eregi_replace("[\]",'',$body);
17 $mail->IsSMTP(); // telling the class to use SMTP
18 $mail->Host = "mail.worxteam.com"; // SMTP server
20 $mail->From = "name@yourdomain.com";
21 $mail->FromName = "First Last";
23 $mail->Subject = "PHPMailer Test Subject via smtp";
25 $mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
27 $mail->MsgHTML($body);
29 $mail->AddAddress("whoto@otherdomain.com", "John Doe");
31 $mail->AddAttachment("images/phpmailer.gif"); // attachment
34 echo "Mailer Error: " . $mail->ErrorInfo;