Hi,
I am breaking my head with this mail() function.
I have a config.inc.php file and in there I have a global variable with i set as:
global $email;
In another php page, I am sending a form using the mail() function.
Here is the example:
// Target email address.
$to = $email;
// Your subject.
$subject = “Registration Confirmation”;
// Sender. You may put the sender’s email address after “from:”. This example file use "[email protected]"
$mail_from=“from: “.$_POST[‘email’].” n”;
#$mail_from=“from: test@localhost n”;
// Set this email to HTML email format.
$mail_from .=“Content-Type: text/html; charset=utf-8 n”;
// Your message.
$message = “Thank you for registering at the User Registration site.
”;
$message .= “To activate your account, please click on this link.”;
$message .= “
”;
mail($to,$subject,$message,$mail_from);
It seems that the “$to” which retrieves the global variable $email doesn’t work.
If i do “echo $email;”, i do see the proper variable, but for some reason, passing it onto to the mail() function gives me the error…
"mail() [function.mail]: SMTP server response: 551 User not local. We don’t relay "
Can anyone help?
Thanks