Smtp 将SwiftMailer与Laravel一起使用时出现错误消息

Smtp 将SwiftMailer与Laravel一起使用时出现错误消息,smtp,laravel,gmail,laravel-4,swiftmailer,Smtp,Laravel,Gmail,Laravel 4,Swiftmailer,我正在尝试使用内置的Laravel4 SwiftMailer包发送电子邮件(Gmail)。我已经成功地在我的本地服务器上发送和接收电子邮件,在直播时,我一直收到以下错误消息: Failed to authenticate on SMTP server with username "info@myemail.com" using 2 possible authenticators 这是控制器: public function show_sent() { $name = Input::g

我正在尝试使用内置的Laravel4 SwiftMailer包发送电子邮件(Gmail)。我已经成功地在我的本地服务器上发送和接收电子邮件,在直播时,我一直收到以下错误消息:

Failed to authenticate on SMTP server with username "info@myemail.com" using 2 possible authenticators
这是控制器:

public function show_sent() {

    $name = Input::get('name', 'someone');
    $email = Input::get('email');

    // I'm creating an array with user's info but most likely you can use $user->email or pass $user object to closure later
    $user = array(
        'email'=>'info@myemail.com',
        'name'=> $name
    );

    // the data that will be passed into the mail view blade template
    $data = array(
        'detail'=>'Visitor\'s website enquiry',
        'name'  => $user['name'],
        'email'=> $email
    );

    // use Mail::send function to send email passing the data and using the $user variable in the Closure
    Mail::send('emails.registration', $data, function($message) use ($user)
    {
      $message->from('info@myemail.com', 'someone');
      $message->to($user['email'], $user['name'])->subject('New Site Registration');
    });

    $view = View::make('sent');
    $view->title = 'Sent';
    $view->keywords = 'to complete'; 
    $view->description = 'to complete';
$view->body_id = 'sent-page';
    return $view;       
}
mail.php设置:

'driver' => 'smtp',
'host' => 'smtp.gmail.com',
'port' => 465,
'encryption' => 'ssl',
我试过使用其他几个gmail帐户,都有相同的错误信息。 任何帮助都会很棒,提前谢谢

尝试从中获取解决方案