Postfix + Symfony sending mail

Posted July 14, 2020 1.6k views
EmailUbuntu 18.04

Hey everyone,
I’m having a hard time understanding how to send email through my PHP application Symfony. I installed Postfix (using this tutorial: and have tested to make sure that the mail can be sent through the console, and it can.

The trick now is to figure out what the proper URL is for my .env file to send emails (variable: MAILER_URL=smtp://localhost). This hasn’t sent anything.

What’s the approach here? Do I use anything specific to point to the right place to send emails?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi there @pixelcommerce,

Are you getting any errors when you try to send the emails?

What I usually do is rather than running my own SMTP server, I use an SMTP solution like SendGrid or MailGun for my Laravel applications. That way I don’t have to set up and maintain a whole SMTP server for 1 website only.