Jump to content

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


Humpty

Recommended Posts

***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
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.