电子邮件未发送 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/