duandi8613 2015-01-04 15:20 采纳率: 100%
浏览 94

在EasyPHP服务器中从Localhost发送邮件

I am new to PHP, and am trying to design a site based on php for my college project. I use EasyPHP devServer 14.0. I have a register page, which mails a verification code to the user to his provided email id. For the demo project, I tried to send a mail from localhost to the user's mail Id, But it showed an error message like this:

Warning: mail(): Failed to connect to mailserver at "127.0.0.1" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()

I ve checked for previously existing solutions, but those solutions are for xampp or wamp servers and the php.ini file content differs between the servers. Could Someone Guide me how to configure the php.ini file in EasyPHP server? Could you please illustrate me with some example?

This is what I ve tried, Pardon me, if it seems to be a simple question.

$pmail = " gotfromuser@example.com";
$subject = " email";
$message = "Hello User";
$headers = "From: admin@example.com" . "
" . "CC: user1@example.com";

mail($pmail,$subject,$message,$headers);
  • 写回答

1条回答 默认 最新

  • douba5540 2015-01-04 15:31
    关注

    Change your php.ini file like this:

    SMTP = smtp.example.com               // Set your SMTP server
    smtp_port = 25                        // Set your SMTP port
    sendmail_from = me@localhost.com      // Set your sender mailaddress
    
    评论

报告相同问题?

悬赏问题

  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用