title: How can I send an email via Swiftmailer
body: <p>I try to send an email via Symfony Swiftmailer:</p>
  <pre><code>&lt;?php
  
  namespace App\Service;
  
  use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  
  class MailGenerator extends AbstractController
  {
      public function __construct(\Swift_Mailer $mailer)
      {
          $this-&gt;mailer = $mailer;
      }
  
      public function sendMail()
      {
          $message = (new \Swift_Message('Hello Email'))
              -&gt;setFrom('mail@mypage.com')
              -&gt;setTo('mail@mypage.com')
              -&gt;setBody(
                  $this-&gt;renderView(
                      'mail/mail.html.twig',
                      ['name' =&gt; 'test']
                  )
              );
  
          $this-&gt;mailer-&gt;send($message);
  
          return $this-&gt;render('mail/mail.html.twig');
      }
  }
  </code></pre>
  <p>But I did not receive any email. What did I miss?</p>