Offre E-mail Pro - Probleme de paramètrage de mail Pro dans .env symfony 5
... / Probleme de paramètrage d...
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Frage

Probleme de paramètrage de mail Pro dans .env symfony 5

Von
CristianoN1
Erstellungsdatum 2022-04-21 14:02:30 (edited on 2024-09-04 14:20:28) in Offre E-mail Pro

Bonjour a tous,
Je rencontre un problème de paramétrage de boite mail OVH PRO sur symfony. Pour un envoi de formulaire de contact.
Dans mon .env j'ai essayé divers paramètres, mais j'ai toujours des erreurs et l'envoi de mail ne fonctionne pas.
Je précise qu'en mettant une adresse Gmail avec le Google mailer ça fonctionne parfaitement.

**Voici les paramètres testés :**

> symfony/swiftmailer-bundle
MAILER_URL=smtp://adressemail@machin.fr:MonMotdepasse@pro1.mail.ovh.net:587

**ou avec**
> symfony/mailer
MAILER_DSN=smtp://adressemail@machin.fr:MonMotDePasse@ssl0.ovh.net:587
J'ai aussi essayé :
MAILER_DSN=smtp://adressemail@machin.fr:MonMotdepasse@pro1.mail.ovh.net:587

Dans mon panneau paramètre Ovh les paramètres de diagnostic MX ET SRV sont au vert , le mode est en Autoritatif.

**Le massage d'erreur :**

> [2022-04-21T15:57:33.830662+02:00] request.CRITICAL: Uncaught PHP Exception Swift_TransportException: "Failed to authenticate on SMTP
server with username "adressemail@machin.fr" using 1 possible authenticators. Authenticator NTLM returned Expected response code 235 b
ut got code "535", with message "535 5.7.3 Authentication unsuccessful "." at /home/procurk/www/procursus/vendor/swiftmailer/swiftmai
ler/lib/classes/Swift/Transport/Esmtp/AuthHandler.php line 191 {"exception":"[object] (Swift_TransportException(code: 0): Failed to a
uthenticate on SMTP server with username \"adressemail@machin.fr\" using 1 possible authenticators. Authenticator NTLM returned Expecte
d response code 235 but got code \"535\", with message \"535 5.7.3 Authentication unsuccessful\r\n\". at /home/procurk/www/procursus/
vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/AuthHandler.php:191)"} []

Merci d'avance pour votre aide !


4 Antworten ( Latest reply on 2022-04-21 14:54:53 Von
CristianoN1
)

Salut,

As tu tenté de mettre le pass entre guillemets doubles ?
>MAIL_PASSWORD="password"

salut @TTY

Je te remercie pour ta réponse.

Oui j'ai également tanté avec le pass entre guillemets doubles, j'ai tjrs la même erreur

> symfony/swiftmailer-bundle
MAILER_URL=smtp://adressemail@machin.fr:"MonMotdepasse"@pro1.mail.ovh.net:587

Penses-tu que c'est mieux de le paramétrer dans .env sur la partie
> symfony/swiftmailer-bundle

ou

> symfony/mailer

?

Je connais pas symfony, mais oui dans le fichier .env les doubles quotes dans l'URL pas sur que ce soit top top.

Ok, en tout cas je te remercie ;)