How can I send an email with php and laravel 5.4?

0

Good afternoon colleagues, I find myself making a form to send emails, the detail that I have is that when I send the email, if I am in my localhost if I send the email successfully, when uploading it to a server it throws me an error and therefore no such email is sent.

I share the function I am doing to send the email.

public function postStoreJobsForm(request $request){

    $nombre = $request['nombre'];
    $email = $request['email'];
    $telefono= $request['telefono'];
    $marca= $request['marca'];
    $modelo= $request['modelo'];
    $puertas= $request['puertas'];
    $color= $request['color'];
    $trasmision= $request['trasmision'];
    $cilindros= $request['cilindros'];
    $kilometraje= $request['kilometraje'];
    $estadoInterior= $request['estadoInterior'];
    $precio= $request['precio'];

    $input = Input::all();

    Mail::send('web.front.email.jobs', [
        'nombre' => $nombre, 
        'email' => $email,  
        'telefono' => $telefono,
        'marca' => $marca,
        'modelo' => $modelo,
        'puertas' => $puertas,
        'color' => $color,
        'trasmision' => $trasmision,
        'cilindros' => $cilindros,
        'kilometraje' => $kilometraje,
        'estadoInterior' => $estadoInterior,
         'precio' => $precio], function ($message) use ($input, $nombre, $email) {
            $message->from($email, $nombre);
            $message->sender('[email protected]', 'Bolsa de trabajo');
         /*Correo para enviar a otras personas */
            $message->to('[email protected]', 'Magaly');
            /*$message->cc('[email protected]', 'ALSanchez');
            $message->cc('[email protected]', 'rrodriguez');
            $message->cc('[email protected]', 'rjagarza');
            $message->cc('[email protected]', 'rjagarza');
            $message->bcc('[email protected]', 'Bruno Chavez');;*/
            $message->bcc('[email protected]', 'Azeneth');

            $message->subject('Quiero Vender Mi Auto');

            $message->priority(3);

            $message->attach($input['archivo']->getRealPath(), array(
            'as' => 'archivo.' . $input['archivo']->getClientOriginalExtension(), 
            'mime' => $input['archivo']->getMimeType()));

             return view('web.front.ofreceAuto');
        });
return redirect()->intended('/web.front.ofreceAuto/');

 }

And this is the error that throws me:

(1/1) ReflectionException
Class Swift_Transport_Esmtp_AuthHandler does not exist

If someone can help me, I'll thank you so much ...

I share the link so you can see the error in detail: P.S. Fill out the form with any information and try to send the email

link

I hope you explained well, thank you in advance

    
asked by Eliobeth Ruiz Hernandez 26.07.2017 в 00:13
source

0 answers