Hi,
If you have installed PHPMailer correctly then use this code and have a check:
<?php require_once("class.phpmailer.php"); $mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
$mail->Host = "mail.yourdomainname"; // SMTP servers
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "SMTP Email Username"; // SMTP username
$mail->Password = "SMTP Email password"; // SMTP password
$mail->From = "From Email address";
$mail->FromName = "Name to Display";
$mail->AddAddress("Recipient Email address ","Recipient Name");
$mail->AddCC(“CC Email Address”);
$mail->AddBCC(“BCC Email address”);
$mail->AddReplyTo("Reply to email address");
$mail->WordWrap = 50; // set word wrap
$mail->IsHTML(true); // send as HTML
$mail->Subject = "Subject";
$mail->Body = "body";
if(!$mail->Send())
{
echo "Message did not sent <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent";
?>
If this does not work then provide exact error message so that you can get proper assistance.
|