se1zure Posted February 2, 2007 Share Posted February 2, 2007 Okay, I've got php to send emails, perfectly fine (for a contact me box I am making. here is, without all teh variables, the code: $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers = "From: $from"; mail($to,$subject,$message,$headers); echo "Mail Sent."; Using this method, the users inputted email adress shows up at the form in my inbox. but html DOES NOT work, and instead, the tags show up. So, for example, if this was the message they typed. Hello! I would like to affiliate! My Website url is: <a href="http://www.blah.com">http://www.blah.com</a> <font color="red">cool</font> then this is what i would see in the email in my inbox: -------------------------------- Hello! I would like to affiliate! My website url is: <a href="blah.com">website</a> <font color="red">cool</font> -------------------------------------------------- The email would be from [email protected]. So.. I rearranged the code like so: $headers = "From: $from"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; mail($to,$subject,$message,$headers); echo "Mail Sent."; Now, the email looks like this: ----------------------------------------------------- Hello! I would like to affiliate! My website url is: http://www.blah.com cool -------------------------------------------------- WHich is what I want, however, now the from email adress shows up as: [email protected] (which is my username and host), inb stead of [email protected] can you help me so i have both html supported emails, and the ability to set the from adrdes in the email. Link to comment https://forums.phpfreaks.com/topic/36841-problemm-with-sending-emails-using-php/ Share on other sites More sharing options...
JasonLewis Posted February 2, 2007 Share Posted February 2, 2007 try this: $headers = "From: $from"; $headers .= 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; see how your missing a . in front of your second $headers = Link to comment https://forums.phpfreaks.com/topic/36841-problemm-with-sending-emails-using-php/#findComment-175766 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.