<?php require_once('class.phpmailer.php'); // $mail = new PHPMailer(); $mail->IsSMTP(); // telling the class to use SMTP $mail->Host = "ssl://smtp.gmail.com"; // SMTP server $mail->SMTPDebug = 1; // enables SMTP debug information (for testing) // 1 = errors and messages // 2 = messages only $mail->SMTPAuth = true; // enable SMTP authentication $mail->SMTPSecure = "ssl"; // sets the prefix to the servier $mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server $mail->Port = 465; // set the SMTP port for the GMAIL server $mail->Username = "gmail@gmail.com"; // GMAIL username $mail->Password = "pass1"; // GMAIL password $mail->From('gmail@gmail.com'); //$mail->AddReplyTo("gmail@gmail.com"); $mail->Subject = $subject; //$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test $mail->Body=$body; $mail->AddAddress($email); //$mail->AddAttachment("images/phpmailer.gif"); // attachment //$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment if(!$mail->Send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message sent!"; } ?>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)