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