php - Send mailer Symfony2 -


i use symfony2. action send message , redirect page.

like this

public function myaction() {     ...     code      ...      sendmessagewithswiftmailer()     ....      return $this->redirect(url);  } 

this code work. url takes time opened. how can first open url page , send message? can give me idea?

you can use:

swiftmailer:     spool: { type: file } 

in config_prod.yml and:

swiftmailer:     spool: { type: memory } 

in config.yml.

then, in production environment, can create crontab job executes symfony2 command:

app/console swiftmailer:spool:send 

this command send spooled messages.

more info @ symfony.com/doc/current/cookbook/email/spool.html


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -