<?require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
$mail->Host = "mail.yourdomain.com"; // SMTP server
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "you@yourdomain.com"; // SMTP username
$mail->Password = "youremailpassword"; // SMTP password
$mail->From = "you@yourdomain.com";
$mail->FromName = "Your Name";
$mail->AddAddress("somebody@somedomain.com","Somebody name");
$mail->AddReplyTo("You@yourdomain.com","Your Name");
$mail->WordWrap = 50; // set word wrap
$mail->AddAttachment("Path to Attachment "); // attachment
$mail->IsHTML(true); // send as HTML
$mail->CharSet="utf-8";
$mail->Subject = "Here is the subject";
$mail->Body = "This is the <b>HTML body</b>";
$mail->AltBody = "This is the text-only body";
if(!$mail->Send())
{
echo "Message was not sent <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent";
?>