mardi 24 juillet 2018

Class 'Swift_Mime_Headers_UnstructuredHeader' not found in Laravel 5.4

I am sending e-mails from laravel app, the e-mail is working fine in localhost, but not working in production server. Note: Hosted the application in Shared Hosting (As its for personal Use)

My Controller

    public function createapplication(Request $request)
{
    $leaves = Application::create([
        'emp_id' => auth()->user()->id,
        'from_date' => request('from_date'),
        'to_date' => request('to_date'),
        'days' => request('days'),
        'reason' => request('reason')
    ]);

        $fromdate = $request->from_date;
        $to_date = $request->to_date;
        $days = $request->days;
        $reason = $request->reason;

$data = array('name'=>auth()->user()->name, 'From_date'=>$fromdate, 'To_date'=>$to_date, 'Days'=> $days, 'Reason'=>$reason);
Mail::send('mail.leavesmail', $data, function($message) use ($fromdate, $to_date, $days, $reason){   

$message->to('example.com', 'example')->subject('Leave Application');
$message->from('example.com', "example");
$message->cc(auth()->user()->email);
});

    return redirect()->back()->with('status', 'Leave Application Submitted Successfully!');



}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire