mail (PHP) doesn’t work on subdomain

Hello,
My mail scripts (PHP) work on my main domain and on several subdomains, but on one subdomain they don’t work.
I ran a test with a simple script without success

$to = "destinataire@destinataire.com";
$subject = "Test mail PHP";
$content = "Le contenu du mail ";
$headers = "From: Website contact@monsousdomaine.com\r\nReply-To: contact@monsousdomaine.com";
if (mail($to, $subject, $content, $headers)){
echo "Le mail a été envoyé avec succès";}
else
echo "Le mail n'a pas été envoyé";

I get the message "The mail was sent successfully" but the mail is not delivered.
Any idea why?

I created ticket CS16712553

Hi @Driver

I recommend dropping mail() and using PHPMailer with SMTP authentication.

Let me know, best regards.
Sergio Turpín

Hello,
Based on your answer on another topic, I replaced the From address with one from the hosting, and now it works, but that's not satisfactory because it would mean that domains hosted on a multisite setup could not/anymore use the mail function.