Skip to content

Instantly share code, notes, and snippets.

@Propaganistas
Last active March 13, 2024 14:26
Show Gist options
  • Star 42 You must be signed in to star a gist
  • Fork 10 You must be signed in to fork a gist
  • Save Propaganistas/9755257e63301bbd5dd0dacbf4eed5ea to your computer and use it in GitHub Desktop.
Save Propaganistas/9755257e63301bbd5dd0dacbf4eed5ea to your computer and use it in GitHub Desktop.
Laravel MailHog SMTP configuration
# Mailhog
MAIL_MAILER=smtp
MAIL_HOST=0.0.0.0
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
@torressam333
Copy link

Thanks for this

@Pablo-Camara
Copy link

Thanks!

@Dyferro
Copy link

Dyferro commented Apr 27, 2021

Merci!!

@it4pay
Copy link

it4pay commented May 20, 2021

Thanks !

@Link2k5
Copy link

Link2k5 commented May 20, 2021

Thanks!

@ryross
Copy link

ryross commented Jun 10, 2021

I had to use

MAIL_ENCRYPTION=tcp

when using Mailhog on macOS without docker.

@innoflash
Copy link

Thanks a lot

@MubinSayed
Copy link

MubinSayed commented Jul 24, 2021

Mailhog

MAIL_DRIVER=smtp
MAIL_HOST=localhost
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

@willdkp
Copy link

willdkp commented Sep 14, 2021

Note for others:
I had problems with MAIL_HOST=0.0.0.0 but MAIL_HOST=localhost (as suggested by MubinSayed) worked. Thanks!

@jazlaan
Copy link

jazlaan commented Oct 7, 2021

I had to use

MAIL_ENCRYPTION=tcp

when using Mailhog on macOS without docker.

thanks for this, really appreciate it

@KobiMontague
Copy link

Thank you for this, much appreciated!

@abkrim
Copy link

abkrim commented Jan 1, 2022

MAIL_DRIVER is for laravel < 7
MAIL_MAILER is for laravel >= 7

@l30nidaz
Copy link

MAIL_DRIVER=smtp
MAIL_HOST=127.0.0.1
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

@mirbaharamin
Copy link

thanks

@AmrMekkawy
Copy link

AmrMekkawy commented Jun 12, 2022

If you are using Laravel Sail and have mailhog as a service in your docker-compose.yml file, you should set the MailHog configuration like this:

MAIL_MAILER=smtp
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="your.email@exampl.com"
MAIL_FROM_NAME="Your Name"

And, you can check MailHog application UI by visiting this URL: http://localhost:8025

@heyder777
Copy link

Thanks!

@moghwan
Copy link

moghwan commented Jul 26, 2023

Thanks!

@najathi
Copy link

najathi commented Nov 14, 2023

You're using an invalid value (null) for MAIL_ENCRYPTION.
MAIL_ENCRYPTION=null

Use an empty value instead for MAIL_ENCRYPTION:
MAIL_ENCRYPTION=

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment