test_sendmail.php

Go to the documentation of this file.
00001 <?php
00002 
00003 //error_reporting(E_ALL);
00004 error_reporting(E_STRICT);
00005 
00006 
00007 date_default_timezone_set('America/Toronto');
00008 //date_default_timezone_set(date_default_timezone_get());
00009 
00010 include_once('class.phpmailer.php');
00011 
00012 $mail             = new PHPMailer();
00013 $body             = $mail->getFile('contents.html');
00014 $body             = eregi_replace("[\]",'',$body);
00015 
00016 $mail->IsSendmail(); // telling the class to use SendMail transport
00017 
00018 $mail->From       = "name@yourdomain.com";
00019 $mail->FromName   = "First Last";
00020 
00021 $mail->Subject    = "PHPMailer Test Subject via smtp";
00022 
00023 $mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
00024 
00025 $mail->MsgHTML($body);
00026 
00027 $mail->AddAddress("whoto@otherdomain.com", "John Doe");
00028 
00029 $mail->AddAttachment("images/phpmailer.gif");             // attachment
00030 
00031 if(!$mail->Send()) {
00032   echo "Mailer Error: " . $mail->ErrorInfo;
00033 } else {
00034   echo "Message sent!";
00035 }
00036 
00037 ?>

Generated on Mon Dec 8 01:06:46 2008 for Ship-Simulator by  doxygen 1.5.6