<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use Illuminate\Support\Facades\Mail;

class FormController extends Controller
{
    public function enviarEmail(Request $request)
    {
        $email = $request->input('email');

        Mail::send('email.email', [], function ($message) use ($email) {
            $message->to($email);
            $message->subject('Assunto do email');
        });

        return back()->with('status', 'Email enviado com sucesso!');
    }
}
