Firstly, I should mention that I am a brand new beginner to PHP and have no idea what I’m doing with PHP mailer or how to implement it.
So far, I’ve downloaded the PHP mailer snippet from GitHub and uploaded this to my Cpanel which looks something like this:
enter image description here
I am then trying to send a html email using PHP mailer using the following PHP script:
// multiple recipients
$to = '[email protected]' . ', '; // note the comma
$to .= '[email protected]';
// subject
$subject = 'Birthday Reminders for August';
// 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>Joe</td><td>3rd</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>
';
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "rn";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "rn";
// Additional headers
$headers .= 'To: Mary <[email protected]>, Kelly <[email protected]>' . "rn";
$headers .= 'From: Birthday Reminder <[email protected]>' . "rn";
$headers .= 'Cc: [email protected]' . "rn";
$headers .= 'Bcc: [email protected]' . "rn";
// Mail it
mail($to, $subject, $message, $headers);
So far Nothing is happening, I get no errors and no email is being sent. I could really use some guidance on this to know where I am going wrong and to get this to work please.