laravel-mail

Laravel 5.3 Notification Vs Mailable

陌路散爱 提交于 2019-12-03 04:29:04
I am a little confused about whether to use Laravel's Notification or Mailable class. From what I understand, Mailables are used to send only emails whereas Notifications can be used to send emails and sms. In my application, I dont have plans to send sms notifications for now, so I am confused if I should just use the Mailable class in this case. My questions are: If I am only going to be sending emails notifications, is it better for me to use Mailables instead of Notifications? If each emails have different html layout, then would Mailable be the better option? Even if all emails are

Laravel 5 - How Do You Catch an Mail::send() Error?

烈酒焚心 提交于 2019-12-01 15:00:48
I have the following method which sends out an e-mail: Mail::send('emails.configuration_test', array(), function($email)use($request){ $email->to($request->test_address)->subject('Configuration Test'); }); If the above errors out, I'd like to be able to catch the exception. When I use the following: try{ Mail::send('emails.configuration_test', array(), function($email)use($request){ $email->to($request->test_address)->subject('Configuration Test'); }); } catch(Exception $e){ // Never reached } the exception is never caught. Instead I get a Laravel stacktrace as the response if the send()

Laravel 5 - How Do You Catch an Mail::send() Error?

人盡茶涼 提交于 2019-12-01 13:44:35
问题 I have the following method which sends out an e-mail: Mail::send('emails.configuration_test', array(), function($email)use($request){ $email->to($request->test_address)->subject('Configuration Test'); }); If the above errors out, I'd like to be able to catch the exception. When I use the following: try{ Mail::send('emails.configuration_test', array(), function($email)use($request){ $email->to($request->test_address)->subject('Configuration Test'); }); } catch(Exception $e){ // Never reached

Laravel 5.3 Password Broker Customization

元气小坏坏 提交于 2019-11-30 12:12:26
问题 Does anyone know how to override the functions used within laravel's password broker? I know the docs: https://laravel.com/docs/5.3/passwords#resetting-views Give information on what to do for things like views and a few surface level things but it's not clear at all really or maybe I'm not reading it enough times. I already know how to override the ResetsPasswords.php Trait but overriding the functionality of the Password::broker() is for the next layer in. If there is more information

Laravel on Localhost - Connection could not be established with host smtp.gmail.com [Connection timed out #110]

南笙酒味 提交于 2019-11-30 04:39:54
问题 I am trying to use Mailgun 'driver' => env('MAIL_DRIVER', 'mailgun'), 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 'port' => env('MAIL_PORT', 587), MAILGUN_DOMAIN=xxxxxxxxxx, MAILGUN_SECRET=xxxxxxxxxx, MAIL_DRIVER=smtp MAIL_HOST=smtp.mailtrap.io MAIL_PORT=2525 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null The error is a strange one. Why would it be trying to connect to gmail? Connection could not be established with host smtp.gmail.com [Connection timed out #110] Edit: Now I

Changing the Default “Subject” Field for Verification Emails in Laravel 5.7

浪尽此生 提交于 2019-11-30 04:25:34
I'm trying to change the default subject field in the verification email that comes with Laravel 5.7. How and where do I change it? I have searched all over the place by myself and online. Because it's brand new I can't find an answer. Can you help me, please? Thanks! You don't need to code anything. The notification has all the strings wrapped in the Lang class so that you can provide translation strings from english to another language, or even english to english if you just want to change the wording. Look in /vendor/laravel/framework/src/Illuminate/Auth/Notifications/VerifyEmail.php public

Connection could not be established with host mailtrap.io [php_network_getaddresses: getaddrinfo failed: No such host is known. #0]

拥有回忆 提交于 2019-11-28 03:53:02
问题 I am getting below error: Connection could not be established with host smtp.gmail.com [php_network_getaddresses: getaddrinfo failed: No such host is known. 0] My .env file looks like: MAIL_HOST=smtp.gmail.com MAIL_PORT=587 MAIL_USERNAME=xxxxxxxxxxxxxx MAIL_PASSWORD=xxxxxxxx #MAIL_ENCRYPTION=null My mail.php file inside config looks like: /* |-------------------------------------------------------------------------- | Mail Driver |--------------------------------------------------------------