1

I have tried this.

<?php
return array(
  'driver' => 'smtp',
  'host' => 'smtp.sendgrid.net',
  'port' => 587,
  'from' => array('address' => 'from@example.com', 'name' => 'John Smith'),
  'encryption' => 'tls',
  'username' => 'sendgrid_username',
  'password' => 'sendgrid_password',
);


Mail::send('emails.demo', $data, function($message)
{
    $message->to('jane@example.com', 'Jane Doe')->subject('This is a demo!');
});

But i am getting this error:

Failed to authenticate on SMTP server with username "sendgrid_username" using 2 possible authenticators

How to resolve this problem.

Please help me.

cyberlobe
  • 1,783
  • 1
  • 18
  • 30
Parag Bhingre
  • 830
  • 2
  • 11
  • 20
  • Perhaphs http://stackoverflow.com/questions/3547388/php-swift-mailer-failed-to-authenticate-on-smtp-using-2-possible-authenticators may help you? Or one of the other questions on SO regarding that error message. – Drazisil Mar 17 '15 at 07:16
  • now i am getting this error: Expected response code 250 but got code "535", with message "535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 http://support.google.com/mail/bin/answer.py?answer=14257 n10sm20739350pdp.18 - gsmtp " – Parag Bhingre Mar 17 '15 at 07:31
  • Are you sure your account is active and provisioned? https://support.sendgrid.com/hc/en-us/articles/200181648-Help-My-emails-aren-t-being-delivered- – Stephen Lewis Mar 17 '15 at 08:42

1 Answers1

0

Make sure the settings are OK, username and password are correct, the function itself should work as you posted.

Matthias Weiß
  • 508
  • 7
  • 17