How to configure mailer?¶

There are many services used for sending transactional emails in web applications. You can find for instance Mailjet, Mandrill or SendGrid among them.

In Sylius emails are configured the Symfony way, so you can get inspired by the Symfony guides to those mailing services.

Basically to start sending emails via a mailing service you will need to:

  1. Create an account on a mailing service.
  2. In the your .env file modify variable MAILER_URL
MAILER_URL=gmail://username:password@localhost

Emails delivery is disable for test, dev and stage environments by default. The prod environment has delivery turned on by default, so there is nothing to worry about if you did not change anything about it.

That’s pretty much all! All the other issues are dependent on the service you are using.

Warning

Remember that the parameters like username or password must not be committed publicly to your repository. Save them as environment variables on your server.