smtp - Error message when using SwiftMailer with Laravel -
i'm trying send emails (gmail) using built in swiftmailer bundle laravel 4. i've been able send , receive emails on local server, when live, keep receiving error message:
failed authenticate on smtp server username "info@myemail.com" using 2 possible authenticators
here's controller:
public function show_sent() { $name = input::get('name', 'someone'); $email = input::get('email'); // i'm creating array user's info can use $user->email or pass $user object closure later $user = array( 'email'=>'info@myemail.com', 'name'=> $name ); // data passed mail view blade template $data = array( 'detail'=>'visitor\'s website enquiry', 'name' => $user['name'], 'email'=> $email ); // use mail::send function send email passing data , using $user variable in 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 settings:
'driver' => 'smtp', 'host' => 'smtp.gmail.com', 'port' => 465, 'encryption' => 'ssl',
i've tried using few other gmail accounts, had same error message. fantastic, in advance!
Comments
Post a Comment