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...

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

报告相同问题?

悬赏问题

  • ¥60 用visual studio编写程序,利用间接平差求解水准网
  • ¥15 Llama如何调用shell或者Python
  • ¥20 谁能帮我挨个解读这个php语言编的代码什么意思?
  • ¥15 win10权限管理,限制普通用户使用删除功能
  • ¥15 minnio内存占用过大,内存没被回收(Windows环境)
  • ¥65 抖音咸鱼付款链接转码支付宝
  • ¥15 ubuntu22.04上安装ursim-3.15.8.106339遇到的问题
  • ¥15 blast算法(相关搜索:数据库)
  • ¥15 请问有人会紧聚焦相关的matlab知识嘛?
  • ¥15 网络通信安全解决方案