I am using XAMPP and when trying to send email through localhost
I get the following warning:
Warning:
stream_socket_enable_crypto()
: this stream does not support SSL/crypto inC:\xampp\htdocs\12work\class.smtp.php
on line 197
Here is my code:
$mail = new PHPMailer();
$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = "smtp.gmail.com"; // specify main and backup server
$mail->SMTPAuth = true;
$mail->Port = 25;
$mail->SMTPSecure = "tls";
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "sheikh.abm@gmail.com"; // SMTP username
$mail->Password = "mypassword"; // SMTP password
$mail->From = "sheikh.abm@gmail.com"; //do NOT fake header.
$mail->FromName = "MailMan";
$mail->AddAddress("sheikh.abm@gmail.com"); // Email on which you want to send mail
$mail->IsHTML(true);
$mail->Subject = "Just a Test";
$mail->Body = "Hello. I am testing <b>PHP Mailer.</b>";
if(!$mail->Send())
{
echo $mail->ErrorInfo;
}else{
echo "email was sent";
}