电子邮件未发送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 *?发布于 2016-06-24 05:41:29
我想你的配置有问题。
请看官方的博客在这里也看到一个视频教程
只需尝试简单的文本电子邮件:
<?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包?哑剧。
https://stackoverflow.com/questions/38005999
复制相似问题