test_mail.php
Go to the documentation of this file.00001 <?php
00002
00003 include_once('../class.phpmailer.php');
00004
00005 $mail = new PHPMailer();
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!";
00016
00017 $mail->MsgHTML($body);
00018
00019 $mail->AddAddress("whoto@otherdomain.com", "John Doe");
00020
00021 $mail->AddAttachment("images/phpmailer.gif");
00022
00023 if(!$mail->Send()) {
00024 echo "Mailer Error: " . $mail->ErrorInfo;
00025 } else {
00026 echo "Message sent!";
00027 }
00028
00029 ?>