警告通过localhost发送邮件

时间:2016-07-27 08:57:18

标签: php smtp wampserver

我遇到了从localhost服务器发送电子邮件的问题

我遇到了这个问题:

mail():无法连接到" localhost"的邮件服务器端口25,验证您的" SMTP"和" smtp_port"在php.ini中设置或在第14行的C:\ wamp \ www \ mail.php中使用ini_set()

第14行:

 mail($to,$subject,$txt,$headers);

我配置了sendmail.ini:

[sendmail]

smtp_server=smtp.gmail.com

smtp_port=465

smtp_ssl=ssl

default_domain=localhost

error_logfile=error.log

;debug_logfile=debug.log

auth_username= haythem.belhadj@esprit.tn

auth_password=******

pop3_server=

pop3_username=

pop3_password=

force_sender= haythem.belhadj@esprit.tn

force_recipient=

hostname=localhost

apache和php文件夹中的php.ini文件也添加了这一行

" C:\ wamp \ sendmail \ sendmail.exe -t -i"

我该怎么办?

1 个答案:

答案 0 :(得分:0)

打开php.ini文件并取消注释 php_openssl,php_smtp和php_sockets 并重启所有服务。