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); } 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 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 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<[email protected]>"; Try that. 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. 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 Link to comment https://forums.phpfreaks.com/topic/131676-problem-with-mail-function/#findComment-683988 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.