Forums
This topic is locked
Quick mail question.
Posted 22 Nov 2006 05:55:29
1
has voted
22 Nov 2006 05:55:29 Steve Hines posted:
Trying to figure out the right way to define a "from" email address. in this statement.function sendMail($to, $hash) {
$message = "Thanks for registering at Fox Thermal Instruments. In order to enable your login you will
have to validate your e-mail address by clicking on the following link:\n\n";
$message .= "/validate.php?hash=$hash\n\n";
$message .= "All that this will do is confirm to our system that you have received
this e-mail and that the e-mail address that you entered is therefore valid";
mail($to,"My message",$message);
}
Thanks guys!
Edited by - shines on 22 Nov 2006 05:57:34
Replies
Replied 23 Nov 2006 17:08:07
23 Nov 2006 17:08:07 Alan C replied:
this is how I assembled part of my email:
mail('. . . . . . .
."\n\n".'Sent from IP : '.$_SERVER['REMOTE_ADDR']."\n"."User agent was : ".$_SERVER['HTTP_USER_AGENT'], 'From:'.$_POST['email']
."\n\n"
);
I think $message .='From: '; just before the mail( . . . lline will do it.
It's a while since I coded it and I've not done much php since, I can't remember whether or not the , before the from string is needed or not.