我有一个我创建的网站,与我们联系页面,我想向用户发送邮件。我已经制作了php邮件程序代码,但是当我提交“联系我们”按钮时,问题就来了(SMTP错误:无法连接到SMTP主机。)请帮助我做错了。
我的PHP邮件代码:
$mail = new PHPMailer;
$mail->IsSMTP();
$mail->SMTPDebug = 0;
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'ssl';
$mail->Host = "smtpout.secureserver.net";
$mail->Port = 465;
$mail->SMTPAuth = true;
$mail->Username = "what is the username";
$mail->Password = "what is the password";
$mail->setFrom('mail@sell.com', 'Raja');
$mail->addAddress($email , $name);
$mail->isHTML(true);
$mail->send();
答案 0 :(得分:1)
ssl
模式用于端口465时您不会得到很多帮助