Guest User

Untitled

a guest
Feb 16th, 2018
378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. public function sendAccountActivationLink(Array $data, Swift_Mailer $mailer)
  2. {
  3. $message = (new Swift_Message('Hello Email'))
  4. ->setFrom('myemail@gmail.com')
  5. ->setTo($data['email'])
  6. ->setBody(
  7. $this->renderView(
  8. 'mails/registration.html.twig',
  9. ['data' => $data]
  10. ),
  11. 'text/html'
  12. )
  13. ;
  14.  
  15. $mailer->send($message);
  16. }
  17.  
  18. $this->get('mailer')->send($message);
  19.  
  20. swiftmailer:
  21. url: '%env(MAILER_URL)%'
  22. spool: { type: 'memory' }
  23. transport: smtp
  24. username: myemail@gmail.com
  25. password: password
  26. host: localhost
  27. port: false
  28.  
  29. MAILER_URL=gmail://myemail@gmail.com:password@localhost
Add Comment
Please, Sign In to add comment