Mail() php function and 000webhost

Hi, i was trying the function mail() and i tried to send a mail to @yopmail.com but it doesn’t work and, after a try with my personal mail, i think that 000webhost has a blacklist. Could you tell me more banned domains? Thanks and best regards

000webhost doesn’t have a blacklist on sending emails from PHP scripts.

Please make sure you have not exceeded the daily mail quota (max 50 emails/day). Also, make sure you have enabled mailing from cPanel > Settings > General > Sendmail > On.

When you’re sending an email, it’s important to specify the headers. Otherwise, your email could be marked as spam, and blocked by the provider from reaching the mailbox.

Please use this code. Replace the variables with the proper values.

<?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);
?>
1 Like

Oh, i didn’t set an header, i thought that i can use mail() only with automatically generated header. In fact, on my mail it works, only with yopmail it doesn’t.
Thank youuu

1 Like