سلام PHPMailer کار نمیکنه
ارورش اینه که نمیتونه به SMTP وصل بشه
function send_email($towho,$subject,$content) {
require_once("class/PHPMailer.php");
require_once("class/SMTP.php");
require_once("class/Exception.php");
$mail = new PHPMailer\PHPMailer\PHPMailer();
$mail->IsSMTP();
$mail->CharSet = 'UTF-8';
$mail->Host = "smtp.gmail.com";
$mail->SMTPDebug = 1;
$mail->SMTPAuth = true;
$mail->SMTPSecure = "ssl";
$mail->Port = 465;
$mail->Username = "usr";
$mail->Password = "pwd";
$mail->SetFrom("usr");
$mail->AddReplyTo("me");
$mail->AddAddress($towho);
$mail->Subject = $subject;
$mail->IsHTML(true);
$message = $content;
$body = "<h3>".$message."</h3>";
$mail->MsgHTML($body);
$mail->AltBody= $message;
if($mail->send())
return 1;
else
return 0;
}
آیا تابع مشکلی داره؟