2015-10-28 10 views

回答

5

您可以配置不同的电子邮件程序。例如:

swiftmailer: 
    default_mailer: spool_mailer 
    mailers: 
     spool_mailer: 
      spool: 
       type: file 
       path: /path/to/spool 
      # ... 
     instant_mailer: 
      # ... 

然后使用一个电子邮件使用者或其他取决于你是否想阀芯或不:

//in your controller 
$spoolMailer = $this->get('swiftmailer.mailer.spool_mailer'); 
$spoolMailer->send(...); //this will be spooled 

$instantMailer = $this->get('swiftmailer.mailer.instant_mailer'); 
$instantMailer->send(...); //this will be sent instantly 
+0

好像工作:) Thaks很多卡洛斯 –

相关问题