Send Html Email Using Php - Not Working When Using Email.2015@gmail.com?
I am using this basic php code to send out a html email. When i use email@email.com as a to address the script works. However, when i try to use email.2015@gmail.com the script say
Solution 1:
For your question recently closed: https://stackoverflow.com/questions/34106770/send-email-using-php-from-address-not-working
Try this:
$headers .= "From: Your Name <$from>\r\n";
and you can also add the 5th mail parameter:
mail($to, $subject, $body, $headers, '-finfo@userforum.com')
.
Works for me with these headers:
$from="$name <$email>\r\n";
$to="$username <$useremail>\r\n";
$headers= 'MIME-Version: 1.0' . "\r\n";
$headers.= 'Content-type: text/html; charset=utf-8' . "\r\n";
$headers.="From: $name <$email>\r\n";
$headers.="Reply-To: $name <$email>\r\n";
Solution 2:
you are using Apostrophe(‘) instead of quotes(')
try this -
$to = 'email.2015@gmail.com';
instead of this -
$to = ‘email.2015@gmail.com’;
Post a Comment for "Send Html Email Using Php - Not Working When Using Email.2015@gmail.com?"