php - 电子邮件未发送 mdaemon 配置完成但邮件未发送通过且未收到错误 php 文件

标签 php mysql css html email

电子邮件未发送 MDaemon 配置已完成但邮件未发送通过且未收到错误 php 文件或任何其他所需配置 我已完成 MDeamoen 配置已完成但邮件未发送 还需要什么我是 php 和 MDeamon 的新手
代码:

    // 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 *?

最佳答案

我认为您配置不当。

请看官方blog这里也看到一个video tutorial

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

<?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。

Note: If intending to send HTML or otherwise Complex mails, it is recommended to use the PEAR package » PEAR::Mail_Mime.

关于php - 电子邮件未发送 mdaemon 配置完成但邮件未发送通过且未收到错误 php 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38005999/

相关文章:

php - Laravel Blade 如何使用@show Action 打印出 uri

mysql - 每年增加 25 万行,MySQL 性能会下降太多吗?

c# - html Head 标记处的 runat ="server"导致 c# 嵌入式代码块无法转换为客户端代码

jquery - 为什么我的 jQuery 单击处理程序没有触发?

html - 谷歌浏览器问题从@font-face渲染字体

PHP in_array() 总是返回 false

php - 如何在浏览器的同一页面中获取 HTML 表单结果?

php - 如何显示 Blob 图像

c# - 我正在尝试插入到数据库中,但出现了一个名为溢出的错误

PHP/MYSQL 帮助 - 意外的 T_VARIABLE