Friday, 6 September 2013

PHP mail not working with 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.
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\">";
?>

No comments:

Post a Comment