简体   繁体   English

PHP邮件不适用于Exchange 2013

[英]PHP mail not working with Exchange 2013

I used this code previously and it worked with Microsoft exchange 2010. Now that my corporation uses Microsoft exchange 2013, it does not work. 我以前使用过此代码,并且可以在Microsoft Exchange 2010中使用。现在,我的公司使用Microsoft Exchange 2013,因此无法使用。

Can anyone tell me why this is happening? 谁能告诉我为什么会这样吗?

<?php

ini_set ("SMTP","mail.***.com");
ini_set("sendmail_from","motabaat@***.com");
$to         = $row_assignto['Email'];      //$row_senmailto['Email'];
$subject    = $row_DetailRS1['TaskName'];
$mail_body  ='<html>
  <p align="right"><strong>
  الاخوة والاخوات     مع حفظ الألقاب
  </strong></p>
  <p align="center"><strong>  الموضوع : ' .$subject. ' </strong></p>
  <p align="right"><strong> ,,,تحية طيبة وبعد  </strong></p>        
  <p align="right"><strong>  يهديكم مكتب معالي الأمين  العام  أسمى التحيات، وبرجاء متابعة     الموضوع أعلاه </strong></p>
  </strong></p>
  <p align="right"><strong>.
  لمعاينة المتابعة <a href="my link"> إضغط هنا </a> </strong></p>
  <p>&nbsp;</p>
  <p align="center"><strong>وتفضلوا بقبول فائق الإحترام     والتقدير،،،،</strong></p>
  <p align="left"><strong>  مكتب معالي الأمين  العام   
  </body>  
  </html>';


$header .= "MIME-Version: 1.0\r\n";
$headers = "Content-type: text/html" . "\r\n" .
$headers .= "Content-Transfer-Encoding: 7bit\r\n\r\n";
$headers .= "motabaat@pmo.gov.ps" . "\r\n" . 
"CC:".$row_DetailRS1['AssignCc'];


mail($to, $subject, $mail_body, $headers); 

echo "<meta http-equiv=\"refresh\" content=\"0;URL=indexadmintask.php\">"; 

?>

This may not be your whole problem, but I'm sure this doesn't help: 这可能不是您的全部问题,但是我确定这没有帮助:

$header .= "MIME-Version: 1.0\r\n";
$headers = "Content-type: text/html" . "\r\n" .
$headers .= "Content-Transfer-Encoding: 7bit\r\n\r\n";
$headers .= "motabaat@pmo.gov.ps" . "\r\n" . 
"CC:".$row_DetailRS1['AssignCc']; 

should be rewritten as: 应该改写为:

$header = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type: text/html" . "\r\n";
$headers .= "Content-Transfer-Encoding: 7bit" . "\r\n\r\n";
$headers .= "Reply-To: motabaat@pmo.gov.ps" . "\r\n"; // guess
$headers .= "Cc: " . $row_DetailRS1['AssignCc'];

That's assuming the actual content of the headers is correct... 假设标头的实际内容是正确的...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM