Jump to content


Photo

Strange From output sending an email ***SOLVED***


  • Please log in to reply
2 replies to this topic

#1 Humpty

Humpty
  • Members
  • PipPipPip
  • Advanced Member
  • 132 posts

Posted 04 September 2006 - 12:37 PM

***SOLVED*** (thanks to Daniel0)

G'day Guys,

I get some strange out put for the "FROM" when recieving an email.

Code used:
$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);

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
- Humpty
  #> Where does the light go when it goes out?

#2 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 04 September 2006 - 03:48 PM

Change
$uFromWho = "From:$frmName\r\nReply-to: $frmEmail\r\nX-Mailer: PHP/" . phpversion();
to
$uFromWho = "From: {$frmName} <{$frmEmail}>\r\nReply-to: {$frmName} <{$frmEmail}>\r\nX-Mailer: PHP/" . phpversion();

Note that it's not the curly brackets that do it, I just think it looks nicer.

#3 Humpty

Humpty
  • Members
  • PipPipPip
  • Advanced Member
  • 132 posts

Posted 04 September 2006 - 11:09 PM

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
- Humpty
  #> Where does the light go when it goes out?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users