I can’t seem to send any mail using PHP’s mail() function whenever I specify the addtional_headers parameter.
<?php
mail('email@email.com', 'subject', 'message here');
?>
Works fine, but
<?php
$headers = 'MIME-Version: 1.0' . PHP_EOL;
$headers .= 'Content-type: text/html; charset=iso-8859-1' . PHP_EOL;
$headers .= 'From: Me <me@email.com>' . PHP_EOL;
mail('email@email.com', 'subject', '<h1>message</h1>', $headers);
?>
Doesn’t deliver any messages at all.
Are there any reasons why this might be occurring?
I can guarantee that your code works fine
as-isas I’ve tested the actual code you provided and got the email sent to my specified email address – I see it in my inbox with a bigmessagewith<h1>. I tested it in a server that’s capable of sending an email. Your issue may be your server not letting you or if it’s a localhost you may need to set it up with a SMTP server- if it is indeed sending, worth a try to check your spam folder ;p