Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel mail success or failure

/**
 *  Send Mail from Parts Specification Form
 */
public function sendMail(Request $request) {
    $data = $request->all();

    $messageBody = $this->getMessageBody($data);

    Mail::raw($messageBody, function ($message) {
        $message->from('yourEmail@domain.com', 'Learning Laravel');
        $message->to('goper.zosa@gmail.com');
        $message->subject('Learning Laravel test email');
    });

    // check for failures
    if (Mail::failures()) {
        // return response showing failed emails
    }

    // otherwise everything is okay ...
    return redirect()->back();
}
Comment

PREVIOUS NEXT
Code Example
Php :: php redirect to page 
Php :: laravel subdays 
Php :: php variable outside foreach 
Php :: php carbon convert string to date 
Php :: php while loop array 
Php :: get the page content in wordpress 
Php :: get current user email wordpress 
Php :: how to fetch jQuery in wordpress 
Php :: php upload file via curl 
Php :: php check weekday of date 
Php :: laravel check if session variable exists 
Php :: artisan refresh 
Php :: php datetime to timestamp 
Php :: laravel model increase the value by one 
Php :: Use debug bar - Laravel 
Php :: php string to char array 
Php :: wordpress throw to debug.log 
Php :: minuscule string php 
Php :: php remove specific element from array 
Php :: php chunk array 
Php :: how to one increment after post in laravel collective 
Php :: php search in object. array 
Php :: Too Many Attempts. laravel error 
Php :: php quit 
Php :: wordpress get child posts 
Php :: pdo get row count 
Php :: php keep only letters and numbers 
Php :: migration with seeder laravel 
Php :: how to install multiple php versions ubuntu 
Php :: laravel update and insert transaction 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =