test_mail.php

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

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