V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
jacob
V2EX  ›  问与答

php mail() 配置的问题

  •  
  •   jacob · 2015-03-14 15:20:41 +08:00 · 1891 次点击
    这是一个创建于 3337 天前的主题,其中的信息可能已经有所发展或是发生改变。

    windows,xampp,php.ini 和sendmail.ini均配置完毕,在后者中开启了

    error_logfile=error.log
    debug_logfile=debug.log
    

    现在php_mail.log中有发送记录,但是sendmail却没有日志文件,邮件也收不到,请问怎么回事。

    4 条回复    2015-03-14 23:01:23 +08:00
    jacob
        1
    jacob  
    OP
       2015-03-14 15:24:10 +08:00
    我怀疑是sendmail根本就没起作用,否则好歹有debug文件啊,这是我php.ini中sendmail的配置
    sendmail_path = "\"E:\xampp\sendmail\sendmail.exe\" -t"
    raincious
        2
    raincious  
       2015-03-14 15:42:12 +08:00
    你可以直接试一下sendmail啊。

    记得好像是用命令行:
    sendmail [email protected] blablabla

    另外其实你可以找一个PHP的Socket库来直接用fsocketopen发送邮件的,没必要非得添加一个基础设施。
    txlty
        3
    txlty  
       2015-03-14 15:51:03 +08:00
    建议自己模拟smtp协议写个函数。smtp是纯文本协议,不难。
    Fedor
        4
    Fedor  
       2015-03-14 23:01:23 +08:00
    用这个 phpmailer 多省事。
    https://github.com/PHPMailer/PHPMailer
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2427 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 13:55 · PVG 21:55 · LAX 06:55 · JFK 09:55
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.