Check the logs
Feb 21, 2019
14
Level 1
Laravel Mail does not send to mailtrap
Hi guys, i'm having trouble sending mail i'm using mailtrap. Page redirects without errors and do not send mail, sometimes it says "Process could not be started [The system cannot find the path specified. ]" i have tried using mail_driver = mail but that do not work.
.env
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=ffc415fa96e9b8
MAIL_PASSWORD=4c04fc5918df03
MAIL_ENCRYPTION= tls
Controller public function PostContact(Request $request) {
$data = array(
'email' => $request -> email,
'subject' => $request -> subject,
'bodyMessage' => $request -> message
);
Mail::send('emails.contact', $data, function($message) use ($data){
$message -> from($data['email']);
// $message -> to($data['[email protected]']);
$message ->subject($data['subject']);
});
Session::flash('success', 'Your Email was sent!');
return redirect() -> back();
}
Thanks!
Please or to participate in this conversation.