test_smtp.php

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

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