duancan1950 2013-04-09 15:19
浏览 40

我的Intranet网站上的邮件功能未激活

I've just built a website for my company and have placed it on a server. It's working perfectly. The website contains a form page that collects request from staff. The form sends the information to the database. I placed code there for it to send a mail to my inbox so that I can be notified after a staff member fills the form. Unfortunately, the mail doesn't get to me. Please I need help on how to go about it.

I am using XAMPP at my back end. Below is the code that involves the mail part:

<?php
$to = "seyioyedeji31@yahoo.com";
$subject = "Test mail";
$message = "<html>
<head>
    <title>MIS HELP SUCCESSFUL</title>
</head>
<body>
    <p>Here are the query details:</p>
    <p><table border=1 style= background:#0B0B61>
       <tr><td> SENDER: $_POST[fullname]</td></tr> 
       <tr><td> DEPARTMENT: $_POST[department]</td></tr>
       <tr><td> NATURE OF PROBLEM: $_POST[nature]</td></tr>
       <tr><td> DETAILS: $_POST[mail]<td></tr>
       </table></p>

</body>
</html>";

$from = "seyioyedeji@mis.com";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?> 
  • 写回答

1条回答 默认 最新

  • duanhan3067 2013-04-09 20:36
    关注

    Mail could be broken at any number of points. Without knowing more, these are the points that come to mind:

    • There is no local mail agent to route mail from the box to the next mail relay.
    • PHP wasn't configured with email support that xampp might need.
    • The box has no outbound mail rights. ACL, firewall, etc.
    • The email is getting sent out, but is being delivered to a local account on the server.
    • Your email provider is filtering out the email as spam.

    Edit:

    After a bit of looking, looks like this might be of help:

    http://expertester.wordpress.com/2010/07/07/how-to-send-email-from-xampp-php/

    which is based on another's solution from:

    http://egrasp.wordpress.com/2010/02/03/sending-email-in-php-using-xampp-lite-1-7-3-on-windows/

    But looks like XAMPP has its own special email sending configs. :)

    If you want to configure XAMPP to deliver via localhost, you may need to install a local email service like postfix to handle outbound delivery, which is what I would normally do on a host. Though only have it listen on localhost to avoid abuse by spammers.

    Normal localhost tests I would run:

    uptime | mail you@email.address.com
    # replace 'mail' with mailx, sendmail, etc. depending on what you have installed.
    

    But that presumes you have a local mail handler installed.

    评论

报告相同问题?

悬赏问题

  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line