Book Image

Symfony2 Essentials

Book Image

Symfony2 Essentials

Overview of this book

Table of Contents (17 chapters)
Symfony2 Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Swiftmailer


As mentioned earlier, Symfony2 provides a default mailer component called swiftmailer. Its default configuration looks like this:

# app/config/config.yml
# ...
# Swiftmailer Configuration
swiftmailer:
    transport: "%mailer_transport%"
    host:      "%mailer_host%"
    username:  "%mailer_user%"
    password:  "%mailer_password%"
    spool:     { type: memory }

The parameters are taken from the parameters.yml file. By default, swiftmailer sends from a locally configured SMTP host, so check your configuration and adapt it as required.

There is one configuration tweak added by default to config_dev.yml (so working only in the development mode):

#swiftmailer:
#    delivery_address: [email protected]

When uncommented and configured, it will cause swiftmailer to send any e-mail to this specific address, while in the development mode. This is a very useful option, as it allows us to test any e-mail to be sent to any user without sending the real e-mail to them.

Note

This is only a basic list...