[英]SMTP server response: 530 5.7.0 Must issue a STARTTLS command first. windows 7
Well I'm using windows 7 and I am trying to send e-mail with mail() function in php.好吧,我使用的是 Windows 7,我正在尝试使用 php 中的 mail() 函数发送电子邮件。 I wrote and tried a lot but still can not send.我写了并尝试了很多但仍然无法发送。 This is my code:这是我的代码:
ini_set("SMTP","smtp.gmail.com");
ini_set("smtp_port","25");
$to = 'asdf@gmail.com';
$subject = 'hi';
$msg = 'Test';
$headers ='Reply-To: shawn.danisa@gmail.com' . "\r\n" .
'From: postmaster@localhost' ."\r\n" .
'X-Mailer: PHP /' . phpversion();
mail($to, $subject,$msg,$headers);
and I get :我得到:
SMTP server response: 530 5.7.0 Must issue a STARTTLS command first. x42sm11770579eel.41 - gsmtp
I tried with port 587 but then I get :我尝试使用端口 587 但后来我得到:
SMTP server response: 530 5.7.0 Must issue a STARTTLS command first. y51sm11859758eeu.0
Please help with port 465 my page even do not load.请帮助端口 465 我的页面甚至无法加载。 Again I am using windows 7.我再次使用 Windows 7。
使用像 Swiftmailer 这样的库来为你处理这个问题: http ://swiftmailer.org/docs/sending.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.