drtanz Posted November 6, 2008 Share Posted November 6, 2008 Hi i am using the mail() function to send emails and I have declared a header parameter. The problem is that the space between 'My' and 'Company' is not shown in the From area when i receive the email in my inbox. So the From is displayed as MyCompany instead of My Company. Here is the code: //set email headers $headers = "From: My Company"; //send it $mailSent = mail($to, $subject, $message, $headers); } Quote Link to comment https://forums.phpfreaks.com/topic/131676-problem-with-mail-function/ Share on other sites More sharing options...
Imad Posted November 6, 2008 Share Posted November 6, 2008 //set email headers $headers = 'From: My.'\r'.Company'; //send it $mailSent = mail($to, $subject, $message, $headers); } try that. the code thing is removing the backslash so add a backslash before the r Quote Link to comment https://forums.phpfreaks.com/topic/131676-problem-with-mail-function/#findComment-683940 Share on other sites More sharing options...
drtanz Posted November 6, 2008 Author Share Posted November 6, 2008 sorry didnt really get that, i tried the line you provided but i got the error Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING Quote Link to comment https://forums.phpfreaks.com/topic/131676-problem-with-mail-function/#findComment-683964 Share on other sites More sharing options...
Andy17 Posted November 6, 2008 Share Posted November 6, 2008 $headers = "from: My Company<example@dizzit.net>"; Try that. Quote Link to comment https://forums.phpfreaks.com/topic/131676-problem-with-mail-function/#findComment-683981 Share on other sites More sharing options...
DeanWhitehouse Posted November 6, 2008 Share Posted November 6, 2008 Just so you know $headers = 'From: My.'r'.Company'; Should of been $headers = 'From: My.'.r.'Company'; Syntax error. Quote Link to comment https://forums.phpfreaks.com/topic/131676-problem-with-mail-function/#findComment-683982 Share on other sites More sharing options...
drtanz Posted November 6, 2008 Author Share Posted November 6, 2008 ok sorted thanks Quote Link to comment https://forums.phpfreaks.com/topic/131676-problem-with-mail-function/#findComment-683988 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.