0
votes

i try to send an email via Symfony2 with SwiftMailer.

I have the next configuration in app/config.yml:

mailer_transport: smtp
mailer_encryption: tls
auth_mode: login
mailer_host: mail.manantiales.edu.ar
mailer_user: [email protected]
mailer_password: *******

And in the code:

$r = $this->get('mailer')->send($message);

if($r){
   $session->getFlashBag()->add('ok_recovery', true);
   $session->getFlashBag()->add('msg_recovery', 'Se ha enviado un correo electronico, a la casilla de correo ingresada, con su nueva clave. Recuerde, es posible que su cliente de correo coloque el email en SPAM.');
}else{
   $session->getFlashBag()->add('ok_recovery', false);
   $session->getFlashBag()->add('msg_recovery', 'Servidor ocupado.');
}

return $this->render('CommonBundle:Default:recuperarAcceso.html.twig',array());

The view render, and show the success message, but, after a seconds Symfony says:

Swift_TransportException: Failed to authenticate on SMTP server with username "[email protected]" using 2 possible authenticators

Any ideas ?

1
Can you send an email from your client using those credentials? - Jovan Perovic
@jperovic thanks for reply, the reasson was that the password are wrong ^^ - ramiromd

1 Answers

0
votes

Hope this help viewers, probably your php engine not support Mailer or is not configured yet. (if it is Apache, this is certainly your problem). search about configuration mail in your php engine.
I think below link will help you: https://www.quackit.com/php/tutorial/php_mail_configuration.cfm