Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29905

laravel 5.4 Mailable implements ShouldQueue don't sent email

$
0
0

This work fine and the email is sent to log(MAIL_DRIVER=log) and mailtrap.io(MAIL_DRIVER=smtp) succesfully

            class VerificationNewAccount extends Mailable
            {
                use Queueable, SerializesModels;
                public function __construct()
                {
                }
                public function build()
                {
                    return $this->from('noreply@example.com')
                        ->view('email.verification-request');
                }
            }
            // in controller
            Mail::to('test@gmail.com')->send(new VerificationNewAccount());

When i implement ShouldQueue the email is printed in log(MAIL_DRIVER=log) but when i try to send to mailtrap.io(MAIL_DRIVER=smtp) the email never is sent

            // running the queue in terminal
            php artisan queue:work --queue

then the class implements ShouldQueue

            class VerificationNewAccount extends Mailable implements ShouldQueue
            {
                use Queueable, SerializesModels;
                public function __construct()
                {
                }
                public function build()
                {
                    return $this->from('noreply@example.com')
                        ->view('email.verification-request');
                }
            }
            // in controller
            Mail::to('test@gmail.com')->send(new VerificationNewAccount());

There is no error printed in laravel.log file. i don't know what to do.


Viewing all articles
Browse latest Browse all 29905

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>