app/Http/Livewire/ContactComponent.php
/**
     * Boton enviar mensaje - Formulario de contacto
     */
Boton enviar mensaje - Formulario de contacto
Boton enviar mensaje - Formulario de contacto
public function send(){
        $this->validate([
            'name' => 'required',
            'phone' => 'required',
            'email' => 'required|email',
            'message' => 'required',
        ]);
        $mail = new ContactMailable([
            'name' => $this->name,
            'phone' => $this->phone,
            'email' => $this->email,
            'message' => $this->message
        ]);
        Mail::to($this->email)->send($mail);
        $array = array(
            'ger.cs28@gmail.com'
        );
        foreach($array as $arr){
            Mail::to($arr)->send($mail);
        }
       dd('envia2');
    }
public function send ( ) { $ this -> validate ( [ 'name' => 'required' , 'phone' => 'required' , 'email' => 'required|email' , 'message' => 'required' , ] ) ; $ mail = new ContactMailable ( [ 'name' => $ this -> name , 'phone' => $ this -> phone , 'email' => $ this -> email , 'message' => $ this -> message ] ) ; Mail :: to ( $ this -> email ) -> send ( $ mail ) ; $ array = array ( 'ger.cs28@gmail.com' ) ; foreach ( $ array as $ arr ) { Mail :: to ( $ arr ) -> send ( $ mail ) ; } dd ( 'envia2' ) ; }
Boton enviar mensaje - Formulario de contacto
Boton enviar mensaje - Formulario de contacto
//dd($_POST); //dd($request->all()); // Envío de correo al destinatario /**
         * Creamos un array para enviar una copia
         * del correo a nuestras direcciones
         */ //return redirect()->route('contact.index');