警告:mail():无法连接到邮件服务器" ssl://smtp.gmail.com"端口465,验证您的" SMTP"和" smtp_port"在php.ini中设置或在第18行的C:\ wamp \ www \ send.php中使用ini_set()
我的php文件如下:
<html>
<head>
<title>Sending HTML email using PHP</title>
</head>
<body>
<?php
ini_set("SMTP","ssl://smtp.gmail.com");
ini_set("smtp_port","465");
$to = "sravya.siji@gmail.com";
$subject = "Not using Gmail";
$message = "<b>HTML message</b>";
$message .= "<h1>Manu this is sent from PHP Code....</h1>";
$retval = mail ($to,$subject,$message);
if( $retval == true ) {
echo "Message sent successfully...";
}else {
echo "Message could not be sent...";
}
?>
</body>
</html>
请你帮我解决这个错误! ......提前致谢:)
答案 0 :(得分:0)
您是否尝试过smtp-relay.gmail.com,这是Google在25端口推荐的那个?
另外,您是否检查过您的服务器是否能够与之通信?可能会阻塞某个地方..