Swift_TransportException error in laravel
I am trying to create a contact form that sends a message to my email address. When I checked this I got this error
Swift_TransportException
The expected response code is 250, but received the code "530", with the message "530 5.7.0" First, must issue the STARTTLS command. bv17sm3597476wib.13 - gsmtp "
This is my controller
public function contact()
{
$data = array(
'name' => Input::get('name')
);
Mail::send('emails.contact', $data, function($message){
$message->to('test@gmail.com', 'Nikki')->subject('Login Details');
});
}
and this is my contact .blade.php
{{ Form::open(array('id' => 'contact-frm', 'class' => 'contact-form', 'route' => 'contact')) }}
{{ Form::label('fname', 'Name') }}
{{ Form::text('fname') }}
{{ Form::label('surname', 'Surname') }}
{{ Form::text('surname') }}
{{ Form::label('email', 'Email') }}
{{ Form::text('email') }}
{{ Form::label('message', 'Message') }}
{{ Form::textarea('message') }}
{{ Form::submit('Submit') }}
{{ Form::close()}}
Mail.php
'driver' => 'smtp',
'host' => 'smtp.gmail.com',
'port' => 587,
'from' => array('address' => 'myEmail@gmail.com', 'name' => "Nikki"),
'encryption' => 'tls',
'username' => 'myEmail@gmail.com',
'password' => 'MyPassword',
'sendmail' => '/usr/sbin/sendmail -bs',
'pretend' => false,
+3
source to share