Friday, August 2, 2019

email - PHP mail() doesn't work

I want to script a simple registration form with activation mail and so on. But for some reason mail() doesn't send the emails, or my 3 different email accounts (hotmail,gmail,yahoo) don't receive them and therefore don't even put them in the spam folder.



Code:



    $mailto = 'xxx@example.com';
$subject = 'the subject';
$message = 'the message';
$from = 'system@example.net';

$header = 'From:'.$from;

if(mail($mailto,$subject,$message,$header)) {
echo 'Email on the way';
}
?>


Everytime it outputs 'Email on the way' so mail() returns true, right? I really don't get it, I've even tried to turn off my little snitch (although I didn't block SMTP).

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...