The Mime component allows you to create email messages, but to actually send
them, you need to use the Mailer component. Emails are delivered via a
"transport", which can be a local SMTP server or a third-party mailing service.

Out of the box this component provides support for the most popular services:
Amazon SES, MailChimp, Mailgun, Gmail, Postmark and SendGrid. They are installed
separately, so if your app uses for example Amazon SES, run this command:

1

$ composer require symfony/amazon-mailer

This will add some environment variables in your .env file where you can
configure the specific service you are using:

When you call $this->mailer->send($email), the email message is sent to the
transport immediately. To improve performance, you can leverage the
Messenger component to send the messages later via a Messenger transport.
Read the Sending Messages Async section in the Mailer docs to learn more
about this.

@Sébastien this component is going to replace Swiftmailer ... but not yet. We want to test the new Mailer component well in Symfony 4.3 and polish/tweak the entire experience so we can replace/deprecate Swiftmailer in future versions (ideally Symfony 4.4/5.0 to be released in November 2019).

I had to start a small service for a project a few days ago. I created it with Symfony 4.3 and that's how some how I got everything working in a couple of days, partly thanks to this new Mailer component and its integration with Mandrill / MailChimp API integration.
Thank you for this great new addition to the Symfony ecosystem :)

Thank you for this! We were just given a PHP project that doesn't use Symfony and I was dreading trying to figure out how to deal with usernames, passwords and encryption for `mail()` without resorting to Pear. `Transport::fromDsn()` added to a `new Mailer()` did the trick!