I a trying to send an email from localhost to my email but i alwasy get this error
Connection could not be established with host smtp.gmail.com [Une tentative de connexion a �chou� car le parti connect� n�a pas r�pondu convenablement au-del� d�une certaine dur�e ou une connexion �tablie a �chou� car l�h�te de connexion n�a pas r�pondu. #10060] and i didn't found any solution
this is the controller code
public function contact_sent(Request $request)
{
$emails = "mohamedfarjallah8@gmail.com";
$messages = "This body message......";
$subject = "This is subject from email";
$fromEmail = "mohamedfarjallah8@gmail.com";
$data = array('emails'=>$emails,'messages'=>$messages,'fromEmail'=>$fromEmail,'subject'=>$subject);
Mail::send([],$data, function ($message) use ($data) {
$message->from($data['fromEmail'],'SubText that show in header part of email');
$message->to($data['emails'])->setBody($data['messages']);
$message->subject($data['subject']);
$message->replyTo($data['fromEmail'],'Some text you can test this');
});
echo "Ok you can check your email";exit;
}
and this is the .env configuration
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=2525
MAIL_USERNAME=mohamedfarjallah8@gmail.com
MAIL_PASSWORD=**************
MAIL_ENCRYPTION=tls
Aucun commentaire:
Enregistrer un commentaire