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