0

This is my sample code which I use to send mail but mail not sent on gmail and yahoo mail id. But when I send mail on my server then it send. Is there any problem in code or a server problem.

<?php

$to = 'myemail@myserver.com';
// Subject
$subject = 'Birthday Reminders';

// 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>Johny</td><td>10th</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>
';

$headers  .= 'MIME-Version: 1.0';
$headers .= 'Content-type: text/html; charset=UTF-8';
$headers .= 'From: Birthday Reminder <birthday@example.com>';

mail($to,$subject,$message,$headers);
?>
Asif Rao
  • 199
  • 2
  • 15
Hadi
  • 1
  • 4

0 Answers0