电子邮件没有发送mdaemon配置完成但邮件发送通过,而不是获取错误的PHP文件

时间:2016-06-24 05:12:09

标签: php mysql css html5 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 *?

1 个答案:

答案 0 :(得分:0)

我认为你错过了配置。

请在此处查看官方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。

  

注意:如果打算发送HTML或其他复杂邮件,那就是   建议使用PEAR包»PEAR::Mail_Mime