How to use the 'Mail Catcher' from the commandline ?


  • | 88 points

    E.g. C:\laragon\bin\php\php-8.0.10-Win32-vs16-x64\php.exe artisan some-command-that-mails

    I tried using C:/laragon/bin/sendmail/sendmail.exe but it only blocks. And the default sendmail.ini seems to try to connect to gmail without credentials, instead of some local fake mail server.

    Is there a way to mail from Laravel to the Laragon mail catcher?


    As a kind of 'temporary' solution I found: https://github.com/rnwood/smtp4dev

    In your .env:

    MAIL_MAILER=smtp
    MAIL_HOST=localhost
    MAIL_PORT=25
    MAIL_USERNAME=null
    MAIL_PASSWORD=null
    MAIL_ENCRYPTION=null
    MAIL_FROM_ADDRESS=noreply@example.com
    MAIL_FROM_NAME="${APP_NAME}"
    

    And open http://localhost:5000/ for a 'sent' mail overview.


Log in to reply
 

Looks like your connection to Laragon was lost, please wait while we try to reconnect.