mardi 6 août 2019

Laravel mail - how to debug Mailgun

I'm trying to set up mailgun with laravel (5.3) but returns null, doesn't shows error and dont sends eamil. Also i tried this mailgun params with PHP CURL, its workin as well. Also i have set MAIL_DRIVER=log its working to. How i can debug Laravel Mailgun?

I have installed Guzzle.

I dont install Laravel Queue system. Can be problem because of this?

My log:

    [2019-08-06 13:19:04] local.DEBUG: Message-ID: 
    <21f27....9cf293be62@todo.test>
    Date: Tue, 06 Aug 2019 13:19:04 +0000
    Subject: Activate Your Account
    From: s....@gmail.com
    To: s....@gmail.com
    MIME-Version: 1.0
    Content-Type: text/html; charset=utf-8
    Content-Transfer-Encoding: quoted-printable

    <h2>this is test mail</h2>
    <p>Lorem ipsum dolor sit amet, consectetur</p>

My .env params

MAIL_DRIVER=mailgun
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=2525 //tried other ports 25, 587, and 465
MAIL_USERNAME=postmaster@sandbox5....a6df0f425dfd0.mailgun.org
MAIL_PASSWORD=f6ae0....b4e0a8205b-73ae490d-d2e10d3d
MAIL_ENCRYPTION=TLS
MAILGUN_DOMAIN=sandbox.....f0f425dfd0.mailgun.org
MAILGUN_SECRET=56cc50b....10c62e08-73ae490d-11f1b30a
MAIL_FROM_ADDRESS=postmaster@sandb....df0f425dfd0.mailgun.org
MAIL_FROM_NAME=ToDo

My Contrller

Mail::to('m....r@gmail.com')->send(new SendMail());

if(count(Mail::failures()) > 0){
    return 'Failed to send password reset email, please try again.';
}

My Mail class

    public function build()
        {
            return $this->from('postmaster@san....0f425dfd0.mailgun.org')
                ->subject('Activate Your Account')
                ->view('emails.test');
        }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire