-1

so this is an exemple of fonction : I create an event and depending on the situation I want to send an email to the person with a message

enter image description here

I want to send the mail back-end without any view given that it is notification mail can i do that in laravel ?

do not hesitate to ask for more information/code

NoRage
  • 139
  • 2
  • 12

1 Answers1

0

You are using Mail::raw, so your message (i mean text) should be first argument. And you have to pass @email via use:

$msg = 'Un evement...';
Mail::raw($msg, function ($message) use ($email) {
    $message->to($email);
    $message->subject('Planning');
});
Roman Meyer
  • 2,634
  • 2
  • 20
  • 27
  • i had this error "message": "Class 'App\\Http\\Controllers\\Mail' not found" i don't know how to configure that do I need a controller ? – NoRage Nov 14 '19 at 13:50
  • add in `use` section `use Illuminate\Support\Facades\Mail;` – Roman Meyer Nov 14 '19 at 13:51
  • ok now i had this error "message": "Expected response code 250 but got code \"530\", with message \"530 5.7.1 Authentication required\r\n\"", – NoRage Nov 14 '19 at 13:56
  • https://stackoverflow.com/questions/42574375/laravel-expected-response-code-250-but-got-code-530 – Roman Meyer Nov 14 '19 at 13:57