PHP to Send Mail
-
Hello,
I have Mail Blank setup properly to send mail through our Office 365 account. It send the test mails out fine. But none of my emails from my PHP code is being sent.
The code being used:
// mail to
$to = $superemail;// subject
$subject = ‘Hours Submitted for Approval’;// message
$message = ‘
<html>
<body>
‘ . $super . ‘,<br>
<br>
‘ . $person . ‘ has requested you review his/her hours that have been submitted for approval in the time sheets application.
<br><br>
<b>Comments:</b><br>
‘ . $comment . ‘<br>
<br>
Please follow this link to approve all submitted hours for ‘ . $person . ‘:<br>
<br>
Approve Hours
<br><br>
Thanks,
<br><br>
<b>Your Friendly Neighborhood Time Sheets Program</b></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 .= ‘From: ‘ . $person . ‘ <‘ . $useremail . ‘>’ . “\r\n”;// Mail it
mail($to, $subject, $message, $headers);`
What am I doing wrong? Thank you for any help!
The topic ‘PHP to Send Mail’ is closed to new replies.