Link to home
Start Free TrialLog in
Avatar of Abendago
Abendago

asked on

php mail not sending once I add headers

Why does the below code not send my email? When I remove the "headers" variable from the mail function, it sends right away with no problems.

My $to and $subject and $html vars are set further up but as I said, it works fine as soon as I remove the $headers

I'm trying to send html encoded email.
// 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 .= 'To: Mary <$to>' . "\r\n";
$headers .= 'From: Birthday Reminder <me@somewhere.com>' . "\r\n";

mail($to,$subject,$HTML,$headers);

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of like_php
like_php

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Abendago
Abendago

ASKER

nope, still didn't arrive
SOLUTION
Avatar of Mark Brady
Mark Brady
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial