-1

Hi guys I am building a email confirmation system and for that I need the email() function but is not working This is my code:

$to = $email;
$subject = "Activation Paolo.M346 system";
$from = 'no-reply@techaviationflight.com';
$message = 'Your Activation key is '.$token.' Please Click On This link 
<a href="/folder/folder_system%20/logics/mailvalidation.php? 
id='.$user_id.'&token='.$token.'">Here</a>to activate your account.';
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$header = "From: ". $name . " <" . $mail . ">\r\n";
$result = mail($to,$subject,$message,$headers);
if ($result)return true;
else return false; 

I have tried all things possible from checking with

error_get_last() var_dump() but I can not identify the error

Thanks

1 Answers1

-1

Well, your link isn't going to work... needs to be an absolute (include the https:// part). Other than that it looks good.

In fact, I ran it on my server and I did indeed get mail. The issue is in your system config, check the mail server set up. If you need help with that, assuming you are on a *nix host ask over on https://unix.stackexchange.com

ivanivan
  • 2,155
  • 2
  • 10
  • 11