cant send email using laravel and laragon
-
I used to be able to send emails from my localmachine over a year ago and I belive at that time I was using laragon.
Now I am developing new app and I need to test sending email from my local machine however I get this error:
"Connection could not be established with host smtp.gmail.com [ #0]"
I've got everything configured correctly inside mail.php and .env
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=myemail@gmail.com
MAIL_PASSWORD=adfasfafdafdasfda
MAIL_ENCRYPTION=sslIs it possible to send email from Laravel using Laragon so I can test everything works?
I also tested this and it managed to send the email
Why cant my app send the email?
-
@nermamax : You can use MailHog:
https://forum.laragon.org/topic/886/tutorial-how-to-add-mailhog-to-laragon-and-make-it-autorun-using-procfile
-
actually solution was far simpler change ssl to tsl and it works
-
To implement Laravel mail send function on your website, you need to configure the route as well. In the routes, you need to mention this
<?php
use App\Mail\mailme;
Route::get('/', function () {
Mail::to('me@example.com')->send(new mailme);
return view('emails.mailme');
});