dongzhi8984 2014-02-09 20:11
浏览 31
已采纳

电邮表格不发电子邮件[关闭]

I'm trying to implement contact form to my website and it isn't working. I'm trying to do it by this tutorial. I changed the $myemail variable to my email address and tried it out. I get the "thank you" message but the email never comes.

I also checked comments on this tutorial and some people are saying it works and some are saying it never sends an email. I also checked the code myself very carefully and as far as I know it SHOULD send the email.

It successfully gets email variables and uses them with:

mail($to,$email_subject,$email_body,$headers);

But why isn't it working?

  • 写回答

1条回答 默认 最新

  • dongshungai4857 2014-02-09 20:27
    关注

    it's a Sample for mail() And Works good:

            $to ='Info@sample.com';
            $message = '<a>Hellow</a>';
            $subject ='Hello world';
    $headers = "MIME-Version: 1.0" . "
    ";
    $headers .= "Content-type:text/html;charset=UTF-8" . "
    ";
    $headers .= "From: <sender@email.com>" . "
    ";
    $mail_sent=@mail($to,$subject,$message,$headers);
    echo $mail_sent ? "Success" : "Error";
    

    if this sample not working , Call to Your server Administrator For check Server...

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 关于用python写支付宝扫码付异步通知收不到的问题
  • ¥50 vue组件中无法正确接收并处理axios请求
  • ¥15 隐藏系统界面pdf的打印、下载按钮
  • ¥15 MATLAB联合adams仿真卡死如何解决(代码模型无问题)
  • ¥15 基于pso参数优化的LightGBM分类模型
  • ¥15 安装Paddleocr时报错无法解决
  • ¥15 python中transformers可以正常下载,但是没有办法使用pipeline
  • ¥50 分布式追踪trace异常问题
  • ¥15 人在外地出差,速帮一点点
  • ¥15 如何使用canvas在图片上进行如下的标注,以下代码不起作用,如何修改