Hello,
I have a registration page and when a user registers I want to send their email an activation code.
To test I have the following code.
<?php
//Send activation Email
$to = $Email_address;
$subject = "www.WEBSITE.com/";
$message = "Welcome to my website!\r\rYou, or someone using your email address,
has completed registration at WEBSITE. You can complete registration by clicking the
following link:\rhttp://www.WEBSITE.com/register.php?action=verify&$activationKey\r\r
If this is an error, ignore this email and you will be removed from our mailing list.\r\rRegards,\ ";
$headers = 'From:
[email protected]' . "\r\n" .
'Reply-To:
[email protected]' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
if (mail($to, $subject, $message, $headers))
{
echo 'Success';
}
else
{
echo 'Error';
}
?>
I have the last if else to see if it is sent to not. I do get a Success message, but I don't get an email at the address (I have checked the spam folder). I have checked the email address and it is correct. I have even waited a few hours and nothing.
Why is the email not getting to my account?