title: SwiftMailer Spool Transport
body: <p>In symfony 2, if I create a new swiftmessage instance I can give the transport in it.</p>
  
  <pre><code>$email = \Swift_Message::newInstance( $transport )
  </code></pre>
  
  <p>But how to put the transport in it and how to configure? (like spool path)</p>
  
  <p>I tried:</p>
  
  <pre><code>$transport = new \Swift_Transport_SpoolTransport();
  </code></pre>
  
  <blockquote>
    <p>Catchable Fatal Error: Argument 1 passed to Swift_Transport_SpoolTransport::__construct() must be an instance of Swift_Events_EventDispatcher, none given, called in /Users/mitchel/Projecten/Refurls/src/Refurl/FrontendBundle/Controller/MessageController.php on line 67 and defined in /Users/mitchel/Projecten/Refurls/vendor/swiftmailer/lib/classes/Swift/Transport/SpoolTransport.php line 27</p>
  </blockquote>
  
  <p>so I think I don't use the right class. Who can push me the right way? =)</p>
  
  <hr>
  
  <p>The next code also send it directly</p>
  
  <pre><code>$transport = new \Swift_FileSpool( '../app/spool' );
  $email = \Swift_Message::newInstance( $transport )
  </code></pre>
  
  <p>I figured out that the Swift_Message doesn't expect a tranport.</p>
  
  <pre><code>public function __construct($subject = null, $body = null,
      $contentType = null, $charset = null)
  </code></pre>
  
  <p>It would be nice to give a Transport. The reason that I don't want to configure it in the config is that if I create 2 services and 1 with:</p>
  
  <pre><code>&lt;argument type="service" id="swiftmailer.transport.real" /&gt;
  </code></pre>
  
  <p>This transport.real will ignore the swiftmailer.delivery_address.</p>