/xampp/htdocs/book_apps/PHPMailer
set_include_path('/xampp/htdocs/book_apps/PHPMailer');
require_once 'PHPMailerAutoload.php';
mail = new PHPMailer();
object $mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp.gmail.com'; // Set SMTP server
$mail->SMTPSecure = 'tls'; // Set encryption type
$mail->Port = 587; // Set TCP port
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'YOUR_USERNAME@gmail.com'; // Set SMTP username
$mail->Password = 'YOUR_PASSWORD'; // Set SMTP password
$mail->setFrom('johndoe@example.com', 'John Doe');
$mail->addAddress('janedoe@example.com', 'Jane Doe');
$mail->Subject = 'PHPMailer Test';
$mail->Body $mail->AltBody = 'This body does not use HTML.';
$mail->isHTML(true);
if($mail->send()) {
echo("Message has been sent by PHPMailer.<br />");
} else {
echo("Message could not be sent by PHPMailer.<br />");
echo("Error: " . $mail->ErrorInfo . "<br />");
}
addAddress() method one or more times.send() method. If this method is successful, it returns TRUE. If this method encounters an error, it returns FALSE and sets an error message in the ErrorInfo property.