Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mastermarco's avatar

Ubuntu server doesn't send emails?

I deployed my app on ubuntu server, but emails can't be sent, I use external smtp connection, from locally it is ok. but from forge server emails are not going out... Is there something to activate?

0 likes
6 replies
fabricecw's avatar
  1. Is the outgoing port open on the Forge server. You can check this by wget -qO- portquiz.net:<<port>> while the port is the outgoing SMTP port.

  2. Do you use queueable on your emails? Maybe the queue isn't working.

  3. Did you setup the .env correctly of your app on the Forge server? Maybe you have to use SSL/TLS.

  4. What says the Laravel log?

mastermarco's avatar
  1. successfull test was for 587 and I changed it...
  2. No, only email
  3. I tried to setup "ssl" and "tls", no changes
  4. Laravel log is empty
fabricecw's avatar

Please post the email part of the .env file, the email class and how you fire it.

mastermarco's avatar
MAIL_DRIVER=smtp
MAIL_ENCRYPTION=null
MAIL_HOST=mail.myhost.org
MAIL_PORT=25
MAIL_USERNAME=fjksadier
MAIL_PASSWORD=*************
[email protected]

I use swift mailer to send messages, locally it works with same data without any problems.

fabricecw's avatar
Level 7

Please provide all the requested information above.

Per default, Laravel uses MAIL_FROM_ADDRESS and MAIL_FROM_NAME, not MAIL_ADDRESS. Do you overwrite that somewhere? And have you tried it with port 587?

mastermarco's avatar

MAIL_FROM_ADDRESS -> my parameter is ok. because the config comes from a older version, the value was wrong and not from my domain, thank you very much

Please or to participate in this conversation.