3 include_once('class.phpmailer.php');
5 $mail = new PHPMailer();
6 $body = $mail->getFile('contents.html');
7 $body = eregi_replace("[\]",'',$body);
9 $mail->IsSendmail(); // telling the class to use SendMail transport
11 $mail->From = "name@yourdomain.com";
12 $mail->FromName = "First Last";
14 $mail->Subject = "PHPMailer Test Subject via smtp";
16 $mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
18 $mail->MsgHTML($body);
20 $mail->AddAddress("whoto@otherdomain.com", "John Doe");
22 $mail->AddAttachment("images/phpmailer.gif"); // attachment
25 echo "Mailer Error: " . $mail->ErrorInfo;