You can send email using PHPMailer from your PHP script with SMTP authentication. To use PHPMailer classes, you just need to download PHPMailer class files from the following URL:
https://github.com/PHPMailer/PHPMailer
Following is the sample code to send email from your PHP script with SMTP authentication:
<?php
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â // send via SMTP
$mail->Host    = "smtp.domain.com"; // SMTP servers
$mail->SMTPAuth = true;Â Â Â Â // turn on SMTP authentication
$mail->Username = "email@domain.com";Â Â // SMTP username
$mail->Password = "password"; // SMTP password
$mail->From    = "email@domain.com";
$mail->FromName = "Name";
$mail->AddAddress("Recipient@emailaddress.com","Name");
$mail->AddReplyTo("yourname@domain.com","Your Name");
$mail->WordWrap = 50;Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â // set word wrap
Â
$mail->IsHTML(true);Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â // send as HTML
$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";
?>
Please make sure that you make the changes in the above script as necessary.
Note: You should always verify email address before sending an email campaign.
Dev License: This installation of WHMCS is running under a Development License and is not authorized to be used for production use. Please report any cases of abuse to abuse@whmcs.com
Powered by WHMCompleteSolution