我编写此代码用于通过电子邮件收集信息,此处我使用sendmail插件,但此处生成错误,无法连接到邮件服务器error
我对php.ini进行了一些修改
SMTP = localhost
smtp_port = 25
sendmail_path ="C:\wamp\sendmail\sendmail.exe -t -i";
<?php
$to = 'localhost,wasu3690@gmail.com';
$subject = 'My subject';
$txt = 'Hello world!';
$headers = 'From: wasu3690@gmail.com';
if (mail($to,$subject,$txt,$headers))
echo "Email Sent";
else "not sent";
ini_set("SMTP",'localhost');
ini_set("smtp_port",25);
?>