我在核心php中写了cron作业,邮件发送代码也在那里..由于cron表正确更新,但邮件发送不是工作..cron作业中的邮件代码(核心php),表格正在上传,但邮件发送不起作用
我的代码:
<?php
..............
..............
$subject = "Thank you";
$message = '<table border="0" cellpadding="0" cellspacing="0" width="600" style="font-family: Tahoma, Geneva, sans-serif;font-size: 13px;width:600px; margin:20px auto;"><tr bgcolor="#00ADEF"><td align="center" valign="top" width="100%" style="font-family: Tahoma, Geneva, sans-serif;font-size: 13px;"><table border="0" cellpadding="10" cellspacing="0" width="100%" style="font-family: Tahoma, Geneva, sans-serif;font-size: 13px;"><tr align="center"><td><img src="path/cronjobs/cron_mail_img/mailTempLogo.png" width="198" style="max-width:198px; margin-top: 30px; margin-bottom: 30px;" /></td></tr></table></td></tr><tr bgcolor="#f5f5f5"><td align="center" valign="top" width="100%" class="templateColumnContainer"><table border="0" cellpadding="10" cellspacing="0" width="100%" style="font-family: Tahoma, Geneva, sans-serif;font-size: 13px;"><tr><td class="templateColumnContainer" style="padding:0px 20px;"><p style="font-size:16px; margin-bottom:5px;"><strong>Hi '.$row['payer_fname'].', </strong></p><p style="font-size:16px; margin-bottom:5px;">Thank you for choosing.. !</p><p style="font-size:16px; margin-bottom:5px;">Hope you had a great time.</p><p style="font-size:16px; margin-bottom:5px;">Please share your experience with us by just rating the property where you were living.</p><p style="font-size:16px; margin-bottom:5px;">Please <a href="path/rating/rating.php?prp_id='.base64_encode($row['property_id']).'&usr_id='.base64_encode($row['user_id']).'">rate the property..!</a></p></td></tr><tr style="background-color: #f5f5f5;"><td style="padding:20px;"><p style="font-size:16px; margin:10px 0;">Thanks, </p><p style="font-size:16px; margin:10px 0;">Team XYZ </p></td></tr><tr align="center" style="background-color: #f5f5f5;"><td style="border-top:solid 1px #CCC"> <img src="path/cronjobs/cron_mail_img/ftr-logo.png" width="39" /></td></tr></table></td></tr></table>';
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers .= 'From: Domain<[email protected]>' . "\r\n";
mail($row['payer_email'], $subject, $message, $headers);
..............
..............
?>
请建议东西..
而“邮件发送不工作”是指什么_exactly_? – arkascha
你有错误信息吗?你在http服务器错误日志文件中看到什么吗?你在垃圾邮件文件夹中收到邮件吗?消息是否返回? – arkascha