【发布时间】:2018-05-04 19:11:49
【问题描述】:
我正在创建一个登录页面。为此,注册后我需要将邮件发送给用户进行验证。因此,我需要发送邮件。要发送邮件,我尝试了这样的 mail() 函数,
<?php
//sending email with the php mail()
mail('mahadev.3333@gmail.com', 'Subject Line Here', 'Body of Message Here', 'From: vidya.5555@gmail.com');
?>
我已经配置了 php.ini 文件,如下所示,
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from ="vidya.merahkee@gmail.com"
我使用的是 Windows 64 位。
我也尝试过使用 phpmailer。但是,我没有找到任何解决方案。因为,2 天我正在尝试这个。我无法做到这一点。
谁能帮我解决这个问题?
【问题讨论】:
-
您收到了什么样的错误消息或意外行为? (另外,作为礼仪指针,highlighting the urgency of your question 是不受欢迎的)
-
您的机器上真的运行着 SMTP 服务器吗?尝试运行命令提示符(开始菜单 > 运行 > cmd),然后运行
telnet localhost 25。它连接了吗?