PHP-Nut Posted November 30, 2009 Share Posted November 30, 2009 $to = $row_GetID['email_addr'].',[email protected]'; $subject = 'Thank you for your www.mywebaddress Order'.' ('.$row_GetID['ordernum_ID'].')'; $headers = 'From:[email protected]'; if (mail($to, $subject, $body,$headers)) { echo("<p>Email Sent To Customer Successfully!</p>"); } else { echo("<p>Email To Customer Failed!</p>"); }?> This Code Snippet works fine with normal email programs, such as outlook express but if i download the emails in hotmail, then the from header seams to display as Unknown? In the recieved Emails List, even tho if u open the email Itself, it does show the correct from email address? (ie our Website email address) Is the code wrong in anyway? Thanks Paul. Quote Link to comment https://forums.phpfreaks.com/topic/183406-from-header-showing-unkown-in-hotmail-why/ Share on other sites More sharing options...
taquitosensei Posted November 30, 2009 Share Posted November 30, 2009 see if something along these lines works $headers = 'From: Web at mywebaddress <[email protected]>'; Quote Link to comment https://forums.phpfreaks.com/topic/183406-from-header-showing-unkown-in-hotmail-why/#findComment-968082 Share on other sites More sharing options...
PHP-Nut Posted November 30, 2009 Author Share Posted November 30, 2009 No, That Doesnt work either, When i got a email notification from MSN messenger with that code it said 'message from .' and then in the livemail it said 'unknown' and on opening the email it was showing the correct address???? do you think its down to the web host? Thanks Paul. Quote Link to comment https://forums.phpfreaks.com/topic/183406-from-header-showing-unkown-in-hotmail-why/#findComment-968085 Share on other sites More sharing options...
PHP-Nut Posted November 30, 2009 Author Share Posted November 30, 2009 $headers = "From: [email protected]\r\n"; Seams to Work, Changed the 'To' address ?? ?? ah well lol Thanks Paul Quote Link to comment https://forums.phpfreaks.com/topic/183406-from-header-showing-unkown-in-hotmail-why/#findComment-968093 Share on other sites More sharing options...
oni-kun Posted November 30, 2009 Share Posted November 30, 2009 No, That Doesnt work either, When i got a email notification from MSN messenger with that code it said 'message from .' and then in the livemail it said 'unknown' and on opening the email it was showing the correct address???? do you think its down to the web host? Thanks Paul. I'd recommend including the MIME headers. I'm not 100% sure if the above example was correct.. but let me show you mine. The web host usually doesn't have control of much btw.. // Headers $header = "From: ".$_POST['name']." <[email protected]> " . "\r\n"; //replace POST and address in <>.. $header .= 'MIME-Version: 1.0' . "\n"; $header .= 'Content-type: text/html; charset=UTF-8' . "\r\n"; This makes MSN assume it is a real message and treats it with more compatability. Quote Link to comment https://forums.phpfreaks.com/topic/183406-from-header-showing-unkown-in-hotmail-why/#findComment-968094 Share on other sites More sharing options...
PHP-Nut Posted November 30, 2009 Author Share Posted November 30, 2009 Got an Error about a Unexpected Text String When I tried Your Code, But Anyway it seams to work now.. So Im Happy to be honest i just think messenger didnt like the email address of web@etc... :-\ Wierd Paul Quote Link to comment https://forums.phpfreaks.com/topic/183406-from-header-showing-unkown-in-hotmail-why/#findComment-968121 Share on other sites More sharing options...
PHP-Nut Posted November 30, 2009 Author Share Posted November 30, 2009 $headers = 'From:[email protected]'; There Wasnt a Space After FROM: Thats all that was wrong! DOH! Lol Quote Link to comment https://forums.phpfreaks.com/topic/183406-from-header-showing-unkown-in-hotmail-why/#findComment-968227 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.