PHP - " sendmail_from"没有在php.ini中设置

时间:2015-07-29 17:25:45

标签: php email

设置xampp以便能够通过localhost发送电子邮件。使用这个家伙的指示http://www.root25.com/2014/04/send-email-using-xampp-from-localhost.html,它非常直接。

它出现了一条错误消息:

  

警告:mail():" sendmail_from"未设置在php.ini或custom" From:"   第56行的C:\ xampp \ htdocs \ process.php中缺少标题

PHP代码

if (!($formerrors)) :
    $to         =   "email@email.com";
    $subject    =       "From $myname -- Contact/Booking Page";
    $message    =       "$myname filled out the form";
    $headers    =  'MIME-Version: 1.0' . "\r\n"; 
    $headers    .= 'From: Patrick <email@email.com>' . "\r\n";
    $headers    .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; 

    $replyto    =       "From: $email \r\n".
                                "Reply-To: secondemail@email.com" . "\r\n";

    if (mail($to, $subject, $message, $headers)):
        $msg = "Thanks for filling out our form";
    else:
        $msg = "Problem sending the message";
    endif; // mail form data

endif; // check for form errors

不确定这里有什么问题。有什么建议吗?

0 个答案:

没有答案