PHP Script e-posta gönder

0 Cevap php

Ben PHPMailer kullanarak benim PHP komut dosyası bir e-posta göndermek için bazı kod yazdı. Nedense, komut mesajları göndermiyor.


Here Is My Code:

<?php
require_once("PHPMailer/class.phpmailer.php");
$mail=new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->Host = "ssl://smtp.gmail.com";
$mail->Port = 465;
$mail->Username = "admin@zbrowntechnology.com";
$mail->Password = "PASSHERE";
$mail->SetFrom = "admin@zbrowntechnology.com";
$mail->AddAddress("zach@zbrowntechnology.com.com");
$mail->Subject = "Confirm Web Lock Registration!";
$mail->Body = "Please confirm your Web Lock Registration by clicking here!";
$mail->WordWrap = 50;

if(!$mail->Send())
{
   echo 'Message was not sent.';
   echo 'Mailer error: ' . $mail->ErrorInfo;
} else {
  echo "Message Sent!";
}
?>

This Is The Error Echoed:

SMTP Error: Could not connect to SMTP host. Message was not sent.Mailer error: SMTP Error: Could not connect to SMTP host.

0 Cevap