我有这个代码,一切都在我的本地服务器上运行良好.电子邮件发送没有任何问题.
但现在我将内容传递给网络服务器,我收到了这个错误……
SMTP Error: Could not connect to SMTP host.
SSL在服务器中启用..正确吗?那么,问题是什么?
$mail = new PHPMailer();
$mail->IsSMTP();
$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
$mail->Username = "dnteiro"; // GMAIL username
$mail->Password = "xxx"; // GMAIL password