$email是传过来的
$subject="Naigo test";
$txt="sth.";
$headers="From:Naigo";
mail($email,$subject,$txt,$headers);
没报错也没发出去也没报错,试了好多邮箱都不行,网管说配好了……因为是刚毕业的刚工作不敢问,看别人贴说有返回值,怎么接啊?$res=mail($email,$subject,$txt,$headers);然后echo $res;没东西。

解决方案 »

  1.   

    mail return true 的时候,不一定发出去了.一般是php的问题..
    本地要在php.ini配置中发送email的参数.
      

  2.   

    PHP 实现发送邮件/短信需要哪些开源接口。
      

  3.   

    汗……直接svn+vpn在服务器上做的,还是没告诉我怎么接mail()返回值
      

  4.   

    [mail function]
    ; For Win32 only.
    SMTP = localhost
    smtp_port = 25; For Win32 only.
    ;sendmail_from = [email protected]; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
    ;sendmail_path =; Force the addition of the specified parameters to be passed as extra parameters
    ; to the sendmail binary. These parameters will always replace the value of
    ; the 5th parameter to mail(), even in safe mode.看到没有sendmail_path unix only
      

  5.   

    nginx web 服务器
    unix 是操作系统,
    不一样的.你可以设置下sendmail的文件路径就可以了.