0

im using wp_mail to create contact page my email var is

$subject = 'hello';
$html = 'message here';
$admin_email = 'admin@yahoo.com';
$email = 'email@yahoo.com';
$headers = array('Content-Type: text/html; charset=UTF-8','From: SiteName <'.$email.'>');
wp_mail($admin_email,$subject,$html,$headers);

but it's not working for me

when i remove From: SiteName <'.$email.'> it's working but i need to change site name and sender email so what is wrong with my code

  • try with "From: sitename <$email>" you forget the ending > – mmm Feb 10 '18 at 22:25
  • yes but still not working , thanks – Mouner Mostafa Feb 10 '18 at 22:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.