i use Symfony2, and i need to send Email from my application.
in my config.yml:
swiftmailer:
transport: smtp
encryption: ssl
auth_mode: login
host: smtp.gmail.com
in my config_dev.yml:
swiftmailer:
transport: gmail
When i add the Email and the password it works but i don't want to send from static Email
in my Controller i have this:
$message = \Swift_Message::newInstance()
->setSubject('demande de conge ')
->setFrom($col->getEmailCollaborateur())
->setTo($form->get("emailcdp")->getData())
->setBody($this->render('acmeBundle:Conge:demandeCongeNormal.html.twig', array('conge' => $conge, 'id'=> $this->getUser()->getId())))
;
$this->get('mailer')->send($message);
i have this exception :
Expected response code 250 but got code "530", with message "530-5.5.1
Authentication Required. Learn more at
530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 o10sm16197wia.0 - gsmtp