punjabi Posted July 23, 2008 Share Posted July 23, 2008 hi, im using the mail function as follows $to = $email; $subject = "Welcome"; $mailmessage = "blah"; $headers = "From:mysite.com"; mail($to, $subject, $mailmessage, $headers); The problem is that in the sent mail the from header shows up as :[email protected] How do I get rid of the hosting company stuff? Link to comment https://forums.phpfreaks.com/topic/116130-mail-function-header-issue/ Share on other sites More sharing options...
tibberous Posted July 23, 2008 Share Posted July 23, 2008 From is supposed to be an email address. You get an email address from another email address, not from a domain name. Link to comment https://forums.phpfreaks.com/topic/116130-mail-function-header-issue/#findComment-597176 Share on other sites More sharing options...
vbnullchar Posted July 23, 2008 Share Posted July 23, 2008 you need to have "\r\n"; <?php $to = '[email protected]'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?> Link to comment https://forums.phpfreaks.com/topic/116130-mail-function-header-issue/#findComment-597179 Share on other sites More sharing options...
punjabi Posted July 23, 2008 Author Share Posted July 23, 2008 Thanks for the info guys: How do I prevent this from showing also: mailed-by: gator503.hostgator.com Another question: What is the X-mailer command for? I googled it but all the info went over my head. Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/116130-mail-function-header-issue/#findComment-597189 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.