Bonjour,

J'ai eu un problème d’envoi mail dans un projet. Si $to = xxx@gmail.com, l'envoi de mail est toujours échoué.
j'ai utilisé Symfony 5.1.11 avec Mailer

MAILER_DSN=smtp://xxx@orange.frxx@smtp.orange.fr:25
Ce projet est hébergé sur 1&1, il y a aussi le même problème.

Dans mon controller:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
use Symfony\Component\Mime\Email;
use Symfony\Component\Mailer\MailerInterface;
 
$email = (new Email())
         ->from($from)
         ->to($to)
         ->subject("Subjet")
         ->html("message");
 
$mailer->send($email);

J'ai reçu un
Mail Delivery System ( host gmail.com[74.125.133.26] said: 550
"550-5.7.26 Unauthenticated email from yahoo.fr is not accepted due to domain's\r\n550-5.7.26 DMARC policy)
Toute aide est la bienvenue, même si vous n'êtes pas certains; Merci à tous.