Symfony 2 and Swiftmailer do not work with file overlay

I cannot get file buffering to work with Symfony 2 and Swiftmailer.

This is my configuration.

# Swiftmailer Configuration swiftmailer: transport: %mailer_transport% host: %mailer_host% username: %mailer_user% password: %mailer_password% spool: type: file path: '%kernel.root_dir%/spool' port: %mailer_port% encryption: %mailer_encryption% sender_address: %mailer_sender_address% 

When I send an email, the file is created in the application / spool / default /

Then i ran

 php app/console swiftmailer:spool:send 

and get this answer

 [2015-12-29 18:54:40] Processing default mailer... 1 emails sent 

So it looks like it worked, but nothing was sent, and /var/log/mail.log does not show any new messages.

When I had a configuration configuration for memory buffering, emails worked without any problems, all I changed was config.yml

 swiftmailer: spool: { type: memory } 

changed to

 swiftmailer: spool: type: file path: '%kernel.root_dir%/spool' 

I use sendgrid and postfix to send emails, but I'm not sure if emails even get into postfix, so this probably doesn't matter.

+5
source share
1 answer

The problem turned out to be the default environment. All I had to do was specify an environment other than dev

 php app/console swiftmailer:spool:send --env=prod 
0
source

Source: https://habr.com/ru/post/1239443/


All Articles