Mail() .. Any way to change the "from" part?
Moderator: General Moderators
Mail() .. Any way to change the "from" part?
Okay im working on sending a person an email when someone registers, but the problem is it says from: noone@myhost.com Is there any way to change that so it matches my site? like register@myhost.com ?? I looked at a few tutorials on it, but it seemed like they were just including the "From" part inside the message... Is it possible?
-
jollyjumper
- Forum Contributor
- Posts: 107
- Joined: Sat Jan 25, 2003 11:03 am
Hi Drachlen,
Below is the way I use the mail function with a from email address:
Hope this helps you.
Greetz Jolly.
Below is the way I use the mail function with a from email address:
Code: Select all
$ToMail = "thereceiver@somewhere.nl";
$FromMail = "register@myhost.com";
$Subject = "Example message";
$Content = "This is the content of the message\n\nGreetz Jolly";
$Header = "From: $FromMail\r\n" ."Reply-To: $FromMail\r\n";
$Sendmail = mail("$ToMail","$Subject","$Content", "$Header");Greetz Jolly.