jacob
V2EX  ›  问与答

php mail() 配置的问题

  •  
  •   jacob · Mar 14, 2015 · 2495 views
    This topic created in 4089 days ago, the information mentioned may be changed or developed.

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

    error_logfile=error.log
    debug_logfile=debug.log
    

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

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

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

    另外其实你可以找一个PHP的Socket库来直接用fsocketopen发送邮件的,没必要非得添加一个基础设施。
    txlty
        3
    txlty  
       Mar 14, 2015
    建议自己模拟smtp协议写个函数。smtp是纯文本协议,不难。
    Fedor
        4
    Fedor  
       Mar 14, 2015
    用这个 phpmailer 多省事。
    https://github.com/PHPMailer/PHPMailer
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1278 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 17:15 · PVG 01:15 · LAX 10:15 · JFK 13:15
    ♥ Do have faith in what you're doing.