Error on sending mail, fwrite(): SSL: An existing connection was forcibly closed by the remote host.

Posted 1 month ago by Jaikangam

what will be the reason for this.

my controller

 public function store_contact( Request $request){
       $request->validate([
            'name'=> 'required',
            'email'=> 'required|email',
            'interested'=> 'required',
            'organization_type'=> 'required',
            'organization_name'=> 'required',
            'organization_type'=> 'required',
            'location'=> 'required',
            'message'=> 'required',
        ]);

    $data = array(
            'name'=> $request->name,
            'email' => $request->email,
            'interested'=>$request->interested,
            'organization_type'=>$request->organization_type,
            'organization_name'=>$request->organization_name,
            'location'=>$request->location,
            'message'=>$request->message
        );

    DB::table ('contacts')->insert ($data);

    
      Mail::send('email.contact', $data, function($message) use ($data)
      {
        $message->from($data['email'], $data['name'] );
        $message->to('[email protected]','Nishtha Chouhan');
        $message->subject('New Contact Enquiry');
      });


    return back();

Please sign in or create an account to participate in this conversation.