Humpty Posted September 4, 2006 Share Posted September 4, 2006 ***SOLVED*** (thanks to Daniel0)G'day Guys,I get some strange out put for the "FROM" when recieving an email.Code used:[code]$frmName="Online Livestock Sales - Join Auth Confitmation Code";$frmSubject="Online Livestock Sales - Join Auth Confitmation Code";$mystr=" Thankyou for joining onlinelivestocksales.com.\n\n All you need to do now is login and quote this authentication code to become activated: \n\n Authenticatin Code: " . $SpecialCode ." \n\nRegards,\n The onlinelivestocksales.com Team.";$frmEmail="info@onlinelivestocksales.com";$uFromWho = "From:$frmName\r\nReply-to: $frmEmail\r\nX-Mailer: PHP/" . phpversion();mail($uEmail, $frmSubject, $mystr, $uFromWho);[/code]But the email I get ends up having this displayed in the from field (MS Otlook):Online.Livestock.Sales.-.Join.Auth.Confitmation.Code@mail12.CITY_HERE.ISP_NAME_HERE.com(CITY_HERE.ISP_NAME_HERE was changed from the real details to that displayed by me for posting on the forum. The strange part is that the service info that is added on the end is the recieving mail server, not the sending mail server, and I don't understand where the full stops come from)Thanks guys Quote Link to comment https://forums.phpfreaks.com/topic/19662-strange-from-output-sending-an-email-solved/ Share on other sites More sharing options...
Daniel0 Posted September 4, 2006 Share Posted September 4, 2006 Change [code]$uFromWho = "From:$frmName\r\nReply-to: $frmEmail\r\nX-Mailer: PHP/" . phpversion();[/code] to [code]$uFromWho = "From: {$frmName} <{$frmEmail}>\r\nReply-to: {$frmName} <{$frmEmail}>\r\nX-Mailer: PHP/" . phpversion();[/code]Note that it's not the curly brackets that do it, I just think it looks nicer. Quote Link to comment https://forums.phpfreaks.com/topic/19662-strange-from-output-sending-an-email-solved/#findComment-85795 Share on other sites More sharing options...
Humpty Posted September 4, 2006 Author Share Posted September 4, 2006 Thankyou very much for that I appreciate it.Worked a treat. I've used the previous for a while now without any problems like that.I don't pretend to understand it (even though i did read info RE it when i first used it) but I will use that code from now on.Again Thanks. you da man Quote Link to comment https://forums.phpfreaks.com/topic/19662-strange-from-output-sending-an-email-solved/#findComment-86067 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.