symfony/swiftmailer-bundle

Dotenv

# For Gmail as a transport, use: "gmail://username:password@localhost"
# For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode="
# Delivery is disabled by default via "null://localhost"
MAILER_URL=null://localhost

Generated files

config/packages/dev/swiftmailer.yaml

# See https://symfony.com/doc/current/email/dev_environment.html
#swiftmailer:
#    send all emails to a specific address
#    delivery_addresses: ['me@example.com']

config/packages/swiftmailer.yaml

swiftmailer:
    url: '%env(MAILER_URL)%'
    spool: { type: 'memory' }

config/packages/test/swiftmailer.yaml

swiftmailer:
    disable_delivery: true