Today, We want to share with you laravel mailgun.In this post we will show you laravel smtp mail, hear for laravel send email gmail we will give you demo and example for implement.In this post, we will learn about Send Emails Mailguns Setup Tutorial with an example.
Sending Emails with Laravel and Mailgun
.env
MAIL_DRIVER=mailgun MAIL_HOST=smtp.mailgun.org MAIL_PORT=587 [email protected] MAIL_PASSWORD=pakainfo@tuijdk MAIL_ENCRYPTION=tls
config/services.php
'mailgun' => array( 'domain' => 'pakainfo.com', 'secret' => 'key-98256c09e58-056a9e975c96dd698da0dd', ),
app/Http/routes.php
Route::get('mail', 'MemberController@mail');
app/Http/Controllers/MemberController.php
public function mail() { $member = Member::find(1)->toArray(); Mail::send('emails.mailEvent', $member, function($message) use ($member) { $message->to($member->email); $message->subject('Mailgun Testing'); }); dd('Your Mail Send Successfully'); }
resources/views/emails/mailEvent.blade.php
Hi, I am from www.pakainfo.com from mailgun testing.
I hope you get an idea about laravel send mail using mail class.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.