I have the following setup/parameters:
- PHP 7.1.26
- Windows 10 x64 Professional
- symfony/swiftmailer-bundle 3.5.2
- symfony/console 4.1.11
I want to configure the swiftmailer-bundle to use the fake sendmail
, which is installed at
C:\Program Files (x86)\sendmail
While I have already configured the sendmail_path
in PHP, the swiftmailer-bundle does not actually use this PHP variable at all. Instead it defaults the path to the sendmail executable to
/usr/sbin/sendmail -bs
However, since version 3.0.4, the path (i.e. complete command) should be configurable: https://github.com/symfony/swiftmailer-bundle/pull/185
I put
swiftmailer:
mailers:
default:
transport: sendmail
command: 'C:\Program Files (x86)\sendmail\sendmail.exe -t'
into my app/config/config.yml
and rebuilt the cache. However, when I want to send a test email via
swiftmailer:email:send
it still uses the default command - which of course fails with
[Swift_TransportException]
Process could not be started [The system cannot find the specified path.]
I am not sure what else I could try. I would really like to use the fake sendmail setup in my local environment, because sendmail can be configured to force send any email to a specific address (my address) for testing and always use a specific SMTP.
This is the output of debug:config swiftmailer
:
swiftmailer:
default_mailer: default
mailers:
default:
transport: sendmail
host: 127.0.0.1
username: null
password: null
port: 25
encryption: null
command: 'C:\Program Files (x86)\sendmail\sendmail.exe -t'
url: null
timeout: 30
source_ip: null
local_domain: null
auth_mode: null
delivery_addresses: { }
logging: false
delivery_whitelist: { }