Re: mail(); Help
| From: | Christoph Biernoth | Date: | Mon, 10 Sep 2001 09:09:35 +0000 |
| Subject: | Re: mail(); Help | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-9282@lists.php.net to get a copy of this message | ||
You forgot to declare $sitename and $admin_mail as global variables in your
function.
Either declare them global by adding the following line to your function:
global $site_name, $admin_mail;
or use the PHP-GLOBALS-Array:
function new_user_mail ($username, $password, $email, $name, $homepage){
...
"From: $GLOBALS["site_name"]\r\nReply-to:
$GLOBALS["admin_mail"]\r\n");
}
"Chris Burwell" <cburwell@netzero.net> wrote in message
news:20010909162503.14668.qmail@pb1.pair.com...
> I am having a little trouble getting my script to work correctly. PHP send
> the mail out fine, but when i see the mail in my inbox, it have no from
> address. I have tryed to figure out why this is not working, but i have
gad
> no sucess. I have enclosed the code below, any help is greatly
appreciated!
> ---------------------------
> function new_user_mail ($username, $password, $email, $name, $homepage)
> {
> $subject = "Welcome to the $site_name community!";
> $body = "Thank you for registering to become a memeber of the $sitename
> community!
> You have registered with the following information:
> Username : $username
> Password : $password
> Name : $name
> E-Mail : $email
> Homepage : $homepage
>
> You are now able to login to our community at this time. If you have any
> questions you may contact our administrator.
> If you did not sign up for this account simply reply to this E-Mail with
the
> word 'REMOVE' in the body.
>
> Have Fun!";
> mail($email,
> $subject,
> $body,
> "From: $site_name\r\nReply-to: $admin_mail\r\n");
> }
> ----------------------------------------
>