I don't receive Sending mail

Good morning , i try to send an email from my website , i use this code

<?php $to = 'khalbi@doumeign.tk'; $subject = 'Test'; $message = 'hello'; $headers = 'From: doumeign@gmail.com' . "\r\n" . 'Reply-To: doumeign@gmail.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?>

but i don’t receive anything in my gmail account ! plz help

Try your real email address instead of the freenom one :wink:

thanks for reply , but even if i use the real mail i don’t receive the mail

<?php
$to = 'khalbiamine@gmail.com';
$subject = 'Test';
$message = 'hello';
$headers = 'From: doumeign@gmail.com' . "\r\n" .
'Reply-To: doumeign@gmail.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?>

Hi @Doumeign!

Please try this code instead:

<?php
$to = 'khalbiamine@gmail.com';
$subject = 'Test';
$message = 'hello';
$headers = 'From: doumeign@gmail.com' . "\r\n" .
'Reply-To: doumeign@gmail.com';

mail($to, $subject, $message, $headers);
?>

thanks for reply, i try the code but i have the same problem , i think the problem is not about the code but something else ,

Try the following and reply with the result

<?php
$to = 'khalbiamine@gmail.com';
$subject = 'Test';
$message = 'hello';
$headers = 'From: doumeign@gmail.com' . "\r\n" .
'Reply-To: doumeign@gmail.com';

if(mail($to, $subject, $message, $headers)){
echo "Sent!";
}else{
  echo "Not sent!";
}
?>

Sent! as i said the code is correct but i don’t know why i still don’t receive the mail .

Please try this code. It is provided by bitdegree.org/learn. Replace the variables properly:

<?php
$to = "somebody@example.com";
$subject = "My subject";
$txt = "Hello world!";
$headers = "From: webmaster@example.com" . "\r\n" .
"CC: somebodyelse@example.com";

mail($to,$subject,$txt,$headers);
?> 

If it doesn’t work, either Google blocks one of our mailing nodes (please check your spam inbox as well) either one of our mailing nodes is down.

Also, please make sure you have not exceeded your daily e-mail quota. Go to 000webhost cPanel > Settings > Statistics > Wait 5 minutes > Hit F5

Also, make sure your website can send e-mails: 000webhost cPanel > Settings > General > Send e-mails > On

Just wait a day, this happens rarely to some users, and is fixed in a bit of time :wink:

actualy i tried this code yesterday ^^ i will try this email jack-question@hotmail.fr hope it will work .

i try with an hotmail account and i have the same problem so i think the problem is one of the mailing nodes is down.

Please check your mailing quota as well.

mailing Quota just 28% used

In this case, please check your mailing script back tomorrow.

We are sorry for inconvenience :sweat:

okey thanks for help :slight_smile: i will check it tomorrow and i will reply the result have a nice day .

Please do so :slight_smile:  

Good morning , I wait 2 days befor i reply ^^ but i still have the same probleme

I’ll report this issue to the admins

thank you , have a nice day

Can you delete your website and create again, then try again with mail function?