Search code examples
gmaillaravel-5.5

how to send email into gmail from laravel5.5 without providing smtp_password?


I have a form for making appointment. Whenever users make a appointment the details of users must be sent to official gmail. How can i do it ? Does i need to provide gmail password in environment file. But my client doesn't want to share his password.


Solution

  • This will help

    \Mail::send('appoiment', $data, function($message) use($email) {
                    $message->from('[email protected]', 'Asd Man');
                    $message->to($email);
                    $message->subject('Tittle');
                });
                $this->info("Email was sent to: " . $email);