3 include_once('../class.phpmailer.php');
5 $mail = new PHPMailer(); // defaults to using php "mail()"
7 $body = $mail->getFile('contents.html');
8 $body = eregi_replace("[\]",'',$body);
10 $mail->From = "name@yourdomain.com";
11 $mail->FromName = "First Last";
13 $mail->Subject = "PHPMailer Test Subject via mail()";
15 $mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
17 $mail->MsgHTML($body);
19 $mail->AddAddress("whoto@otherdomain.com", "John Doe");
21 $mail->AddAttachment("images/phpmailer.gif"); // attachment
24 echo "Mailer Error: " . $mail->ErrorInfo;