$mail = new PHPMailer();
$mail->SMTPDebug = 0;
$mail->SMTPAuth = TRUE;
$mail->SMTPSecure = “tls”;
$mail->Port = 587;
$mail->Username = “your gmail username”;
$mail->Password = “your gmail password”;
$mail->Host = “smtp.gmail.com”;
$mail->Mailer = “smtp”;
$mail->SetFrom(“Your from email”, “from name”);
$mail->AddReplyTo(“from email”, “PHPEmail”);
$mail->AddAddress(“recipient email”);
$mail->Subject = “Test email using PHP mailer”;
$mail->WordWrap = 80;
$content = “<b>Test email using PHP mailer class.</b>”; $mail->MsgHTML($content);
echo “Problem sending email.”;
echo “email sent.”;


Download PHPmailer class from HERE

Please login or Register to submit your answer
Not the answer you are looking for? Browse other questions tagged or ask your own question.