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