timmah1 Posted March 13, 2009 Share Posted March 13, 2009 My contact form works perfect, except the FROM: part, it's showing [email protected] I want it to show this: LEO Builders <[email protected]> What am I doing wrong? <?php $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= "From: LEO Builders <[email protected]>\n"; $headers .= "Reply-to: [email protected]\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; mail($to, $subject, $message, $headers) ; // Send Email for each record found ?> Thanks in advance Link to comment https://forums.phpfreaks.com/topic/149254-contact-form-issue/ Share on other sites More sharing options...
The Little Guy Posted March 13, 2009 Share Posted March 13, 2009 The only difference I see from your code and php.net's is that you are using "\n" and they are using "\r\n", and the "To" header. Maybe if you add those, it would work... but I don't see why it won't work. Link to comment https://forums.phpfreaks.com/topic/149254-contact-form-issue/#findComment-783808 Share on other sites More sharing options...
dennismonsewicz Posted March 13, 2009 Share Posted March 13, 2009 i think the way you are doing it won't work per say. The email client usually formats the way the From address looks like... I could be wrong Link to comment https://forums.phpfreaks.com/topic/149254-contact-form-issue/#findComment-783818 Share on other sites More sharing options...
timmah1 Posted March 13, 2009 Author Share Posted March 13, 2009 If I take out the email on this line $headers .= "From: LEO Builders <[email protected]>\n"; it works, I have no idea. I tried user "r\n" on every line, but still nothing. But it works now, not the way I want, but it's working better. Thanks TLG Link to comment https://forums.phpfreaks.com/topic/149254-contact-form-issue/#findComment-783821 Share on other sites More sharing options...
timmah1 Posted March 13, 2009 Author Share Posted March 13, 2009 ok, this is strking me as very odd On my form, I have this $name1 = "LEO Builders <[email protected]>"; $headers = "From: ". $name1 . "\r\n"; $headers .= "Content-Type: text/html; charset=\"iso-8859-1\"\r\n"; $headers .= "Content-Transfer-Encoding: 7bit\"\r\n"; mail($to, $subject, $message, $headers) ; // Send Email for each record found That shows From: being [email protected] But, if I take out the s on the name in the email $name1 = "LEO Builders <[email protected]>"; $headers = "From: ". $name1 . "\r\n"; $headers .= "Content-Type: text/html; charset=\"iso-8859-1\"\r\n"; $headers .= "Content-Transfer-Encoding: 7bit\"\r\n"; mail($to, $subject, $message, $headers) ; // Send Email for each record found The From: shows this LEO Builders <[email protected]> Can anybody tell me why that is? Link to comment https://forums.phpfreaks.com/topic/149254-contact-form-issue/#findComment-783941 Share on other sites More sharing options...
dennismonsewicz Posted March 13, 2009 Share Posted March 13, 2009 I don't see where you took out the S? Link to comment https://forums.phpfreaks.com/topic/149254-contact-form-issue/#findComment-784089 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.