首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >电子邮件未发送mdaemon配置,但未通过邮件发送,也未收到错误php文件。

电子邮件未发送mdaemon配置,但未通过邮件发送,也未收到错误php文件。
EN

Stack Overflow用户
提问于 2016-06-24 05:12:09
回答 1查看 146关注 0票数 0

电子邮件未发送MDaemon配置,但未通过邮件发送,也未获得错误php文件或任何其他所需配置,我已完成MDeamoen配置,但邮件未发送更多必需的邮件,我是php和MDeamon中的新成员。

代码:

代码语言:javascript
复制
    // smtp domain name
    ini_set("SMTP","48.48.48.250");

    //sendmail path for sending email
    ini_set("sendmail_path", "M:\MDaemon\App\MDaemon.exe\ -t -i");

    // Please specify an SMTP Number 25 and 8889 are valid SMTP Ports.

    ini_set("smtp_port","25");

    // Please specify the return address to use

    ini_set('sendmail_from', 'ticketing@solinfinite.com');





    // multiple recipients
    $to  = 'mukeshbpatidar@gmail.com' . ', '; // note the comma
    $to .= 'hr@solinfinite.com';

    // subject
    $subject = 'Birthday Reminders for August';

    // message
    $message = '
    <html>
    <head>
      <title>Birthday Reminders for August</title>
    </head>
    <body>
      <p>Here are the birthdays upcoming in August!</p>
      <table>
        <tr>
          <th>Person</th><th>Day</th><th>Month</th><th>Year</th>
        </tr>
        <tr>
          <td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
        </tr>
        <tr>
          <td>Sally</td><td>17th</td><td>August</td><td>1973</td>
        </tr>
      </table>
    </body>
    </html>
    ';

    // To send HTML mail, the Content-type header must be set
    $headers  = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

    // Additional headers
    $headers .= 'To: Mukesh  <mukesh@solinfinite.com>, Kelly <hr@solinfinite.com>' . "\r\n";
    $headers .= 'From: Birthday Reminder <ticketing@solinfinite.com>' . "\r\n";


    // Mail it
    if(mail($to, $subject, $message, $headers))
        {
        echo 'Email sent successfully!';
    }
     else 
     {

       die('Failure: Email was not sent!');

     }

  /* Code running properly and sent msg successfully but mail not sent if any idea about MDeamon or I have to other Configuration done  on localhost that should be run properly and send mail success *?
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-06-24 05:41:29

我想你的配置有问题。

请看官方的博客在这里也看到一个视频教程

只需尝试简单的文本电子邮件:

代码语言:javascript
复制
<?php
$to      = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
    'Reply-To: webmaster@example.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?>

如果简单的电子邮件工作,那么你需要安装PEAR软件包? PEAR::Mail_Mime。

注意:如果打算发送HTML或其他复杂的邮件,建议使用PEAR包?哑剧

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38005999

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档