title: FosUserBundle confirmation email doesn't work with swiftmailer
body: <p>I want to use the fosuserbundle functionality to send confirmation email and retrieve password etc ... But it is not working. I'm currently working in <code>dev environment</code> on LAMP. I think It could be a config.yml issue but I tried everything...</p>
  
  <p>I assume my config.yml file has to be cleaned up but I'm not sure about what I can delete and what I can't.</p>
  
  <p>Here is my way too large <code>config.yml</code></p>
  
  <pre><code>imports:
      - { resource: parameters.yml }
      - { resource: security.yml }
      - { resource: services.yml }
      - { resource: "@UserBundle/Resources/config/services.yml" }
  
  # Put parameters here that don't need to change on each machine where the app is deployed
  # http://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
  parameters:
      locale: fr
  
  framework:
      #esi:             ~
      translator:      { fallbacks: ["%locale%"] }
      secret:          "%secret%"
      router:
          resource: "%kernel.root_dir%/config/routing.yml"
          strict_requirements: ~
      form:            ~
      csrf_protection: ~
      validation:      { enable_annotations: true }
      #serializer:      { enable_annotations: true }
      templating:
          engines: ['twig']
      default_locale:  "%locale%"
      trusted_hosts:   ~
      trusted_proxies: ~
      session:
          # handler_id set to null will use default session handler from php.ini
          handler_id:  ~
      fragments:       ~
      http_method_override: true
  
  # Twig Configuration
  twig:
      debug:            "%kernel.debug%"
      strict_variables: "%kernel.debug%"
  
  # Doctrine Configuration
  doctrine:
      dbal:
          driver:   pdo_mysql
          host:     "%database_host%"
          port:     "%database_port%"
          dbname:   "%database_name%"
          user:     "%database_user%"
          password: "%database_password%"
          charset:  UTF8
  
      orm:
          auto_generate_proxy_classes: "%kernel.debug%"
          naming_strategy: doctrine.orm.naming_strategy.underscore
          filters:
              softdeleteable:
                  class: Gedmo\SoftDeleteable\Filter\SoftDeleteableFilter
                  enabled: true
          auto_mapping: true
          mappings:
              gedmo_translatable:
                  type: annotation
                  prefix: Gedmo\Translatable\Entity
                  dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Entity"
                  alias: GedmoTranslatable # (optional) it will default to the name set for the mapping
                  is_bundle: false
              gedmo_translator:
                  type: annotation
                  prefix: Gedmo\Translator\Entity
                  dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Translator/Entity"
                  alias: GedmoTranslator # (optional) it will default to the name set for the mapping
                  is_bundle: false
              gedmo_loggable:
                  type: annotation
                  prefix: Gedmo\Loggable\Entity
                  dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Loggable/Entity"
                  alias: GedmoLoggable # (optional) it will default to the name set for the mappingmapping
                  is_bundle: false
              gedmo_tree:
                  type: annotation
                  prefix: Gedmo\Tree\Entity
                  dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Entity"
                  alias: GedmoTree # (optional) it will default to the name set for the mapping
                  is_bundle: false
  
  stof_doctrine_extensions:
      orm:
          default:
              softdeleteable: true
  
  # Swiftmailer Configuration
  swiftmailer:
      transport: "%mailer_transport%"
      host:      "%mailer_host%"
      username:  "%mailer_user%"
      password:  "%mailer_password%"
      spool:     { type: memory }
  
  #Login using email
  security:
      providers:
          fos_userbundle:
              id: fos_user.user_provider.username_email
  
  # FOSUserBundle Configuration
  fos_user:
      db_driver: orm
      firewall_name: main
      user_class: UserBundle\Entity\User
      # Permet de définir quel service de mail utiliser
      # On utilise twig_swift pour pouvoir envoyer un email en HTML
      service:
          mailer: fos_user.mailer.twig_swift
          user_manager: pugx_user_manager
      # Permet de renseigner le nouveau formulaire d'inscription
      registration:
          form:
              type: app_user_registration
          # Permet la validation automatique du compte par envoi d'un email
          confirmation:
              template: UserBundle:Registration:email.txt.twig
              enabled:    true
              from_email:
                  address:        gauthiercoste@gmail.com
                  sender_name:    Gauthier Coste
      resetting:
          email:
              from_email:
                  address:        gauthiercoste@gmail.com
                  sender_name:    Abracadavrac
  
  pugx_multi_user:
    users:
      standard_user:
          entity: 
            class: UserBundle\Entity\StandardUser
          registration:
            form: 
              type: UserBundle\Form\RegistrationStandardUserType
              validation_groups:  [Registration, Default]
      seller:
          entity: 
            class: UserBundle\Entity\Seller
          registration:
            form: 
              type: UserBundle\Form\RegistrationSellerType
              name: fos_user_registration_form
              validation_groups:  [Registration, Default]
            template: UserBundle:Registration:registerProStep1.html.twig
  
  assetic:
      debug:          '%kernel.debug%'
      use_controller: '%kernel.debug%'
      filters:
          cssrewrite: ~
  </code></pre>
  
  <p><code>parameters.yml</code> :</p>
  
  <pre><code># This file is auto-generated during the composer install
  parameters:
      database_host: 127.0.0.1
      database_port: null
      database_name: xxxxxxxxxx
      database_user: root
      database_password: xxxxxxxxxx
      mailer_transport: gmail
      mailer_host: 127.0.0.1
      mailer_user: xxxxxxxxxx@gmail.com
      mailer_password: xxxxxxxxxx
      secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  </code></pre>
  
  <p>My registration process is in my controller RegistrationStandardUserController.php</p>
  
  <pre><code>public function registerAction(Request $request)
  {
          $em = $this-&gt;get('doctrine.orm.entity_manager');
          //Form creation based on my user entity
          $user = new StandardUser();
          $form = $this-&gt;createForm(RegistrationStandardUserType::class, $user);
          $form-&gt;handleRequest($request);
          if ($form-&gt;isSubmitted() &amp;&amp; $form-&gt;isValid()) {
              $user       -&gt;setEnabled(true);
              $em         -&gt;persist($user);
              $em         -&gt;flush();
              if (!$user) {
                  throw new UsernameNotFoundException("User not found");
              } else {
                  $request-&gt;getSession()-&gt;getFlashBag()-&gt;add('success', 'Félicitation '.$user-&gt;getFirstName().', vous êtes inscrit');
                  $this-&gt;authenticateUser($user);
              }
          }else if($form-&gt;isSubmitted() &amp;&amp; !$form-&gt;isValid()){
              $request-&gt;getSession()-&gt;getFlashBag()-&gt;add('error', 'Il y a une erreur dans le formulaire d\'inscription');
          }
  
      return $this-&gt;render('UserBundle:Registration:register.html.twig', array(
              'form' =&gt; $form-&gt;createView()
      ));
  }
  </code></pre>