Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

286
Vistas
React Client to Laravel Backend - Mail is not being Sent

Firstly, I am pretty new in ReactJS and have no prior experience in Laravel, so the question may seem irrelevant or pointless, so any correction is appreciated. I am trying to send an email via using a form on the client side. When I submit the form, the response seems 200 OK and all the data is being sent. But I don't get an email in the account which I am supposed to. Here is the sendMail function on the client, and backend function which is supposed to get post request and send an email with the data in request.

FRONTEND

    const sendMail = async (e) => {
    e.preventDefault();
      const reservationdetail = JSON.stringify(allValues);
      axios
        .post('http://panel.xyz.com/api/send-reservation', {
          reservationdetail: reservationdetail
        })
        .then(function (response) {
          console.log(response);
        })
        .catch(function (error) {
          console.log(error);
        })
        .then(function () {});
      $('.reservation-tab-area').addClass('d-none');
      dispatch(changePage(3));
    }

BACKEND

     public function addReservation(Request $request)
        {
    
            $jsondata = $request;
            Reservation::create(['reservationdetail' => $jsondata->reservationdetail]);
    
            $reservationdetail= $jsondata->reservationdetail;
            $email = 'rezervasyon@xyz.com';
    
            $rezerve= json_decode($reservationdetail);
           
            $offer = [
                'title' => 'İnfo Contact',
                'name' => $rezerve->name,
                'surname' => $rezerve->surname,
                'cityselect' => $rezerve->cityselect,
                'phone' => $rezerve->phone,
                'mail' => $rezerve->mail,
                'message' => $rezerve->message,
                'deliveryCity' => $rezerve->deliveryCity,
                'returnCity' => $rezerve->returnCity,
                'contactViaEmail' => $rezerve->contactViaEmail,
                'contactViaPhone' => $rezerve->contactViaPhone,
                'contactViaWhatsapp' => $rezerve->contactViaWhatsapp,
                'total' => $rezerve->totalAmount,
                'enddate' => $rezerve->endDate,
                'startdate' => $rezerve->startDate,
                'carname' => $rezerve->carselect->name,
                'carclass' => $rezerve->carselect->class,
            ];
           
            Mail::to($email)->send(new OfferMail($offer));
    
        }
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda