Expected response code 235 but got code 535 laravel send email using office365 smtp










0















I want to send email using my office365 smtp credentials in laravel application. i have make changes in my .env file for email settings as below:



MAIL_DRIVER=smtp
MAIL_HOST=smtp.office365.com
MAIL_PORT=587
MAIL_USERNAME=info@***.com
MAIL_PASSWORD=*******
MAIL_ENCRYPTION=tls


while i am trying to send email i got error like



Failed to authenticate on SMTP server with username "info@omoyyc.com" using 2 possible authenticators. Authenticator LOGIN returned Swift_TransportException: Expected response code 235 but got code "535", with message "535 Incorrect authentication datarn"


my email sending code is as below



Mail::send(array(), array(), function ($m) use ($templatecontent) 
$m->from('customerservice@****.com', 'TEST');
$m->to('test@gmail.com', 'Test')
->subject($templatecontent['subject'])
->setBody($templatecontent['content'], 'text/html');
);


Can anyone guide me what is the issue and how to solve this issue?










share|improve this question






















  • Have you cleared your cache with php artisan cache:clear?

    – Sven Hakvoort
    Nov 14 '18 at 11:29











  • can you please tell me how to run this command on live server using cpanel. I have set following routes in my web.php to clear cache.Route::get('/config-cache', function() $exitCode = Artisan::call('config:cache'); return '<h1>Clear Config cleared</h1>'; );

    – Adarsh Bhatt
    Nov 14 '18 at 11:58












  • You can run this in the same location as where you run the composer require or composer update commands (I assume local command line?) and then upload all your project files to the server so the updated files are updated on the server too

    – Sven Hakvoort
    Nov 14 '18 at 12:01











  • i am working on live server directly.

    – Adarsh Bhatt
    Nov 14 '18 at 12:02











  • Do you have a terminal/command line interface/open ssh connection to the server? How have you initialized the laravel project?

    – Sven Hakvoort
    Nov 14 '18 at 12:03















0















I want to send email using my office365 smtp credentials in laravel application. i have make changes in my .env file for email settings as below:



MAIL_DRIVER=smtp
MAIL_HOST=smtp.office365.com
MAIL_PORT=587
MAIL_USERNAME=info@***.com
MAIL_PASSWORD=*******
MAIL_ENCRYPTION=tls


while i am trying to send email i got error like



Failed to authenticate on SMTP server with username "info@omoyyc.com" using 2 possible authenticators. Authenticator LOGIN returned Swift_TransportException: Expected response code 235 but got code "535", with message "535 Incorrect authentication datarn"


my email sending code is as below



Mail::send(array(), array(), function ($m) use ($templatecontent) 
$m->from('customerservice@****.com', 'TEST');
$m->to('test@gmail.com', 'Test')
->subject($templatecontent['subject'])
->setBody($templatecontent['content'], 'text/html');
);


Can anyone guide me what is the issue and how to solve this issue?










share|improve this question






















  • Have you cleared your cache with php artisan cache:clear?

    – Sven Hakvoort
    Nov 14 '18 at 11:29











  • can you please tell me how to run this command on live server using cpanel. I have set following routes in my web.php to clear cache.Route::get('/config-cache', function() $exitCode = Artisan::call('config:cache'); return '<h1>Clear Config cleared</h1>'; );

    – Adarsh Bhatt
    Nov 14 '18 at 11:58












  • You can run this in the same location as where you run the composer require or composer update commands (I assume local command line?) and then upload all your project files to the server so the updated files are updated on the server too

    – Sven Hakvoort
    Nov 14 '18 at 12:01











  • i am working on live server directly.

    – Adarsh Bhatt
    Nov 14 '18 at 12:02











  • Do you have a terminal/command line interface/open ssh connection to the server? How have you initialized the laravel project?

    – Sven Hakvoort
    Nov 14 '18 at 12:03













0












0








0








I want to send email using my office365 smtp credentials in laravel application. i have make changes in my .env file for email settings as below:



MAIL_DRIVER=smtp
MAIL_HOST=smtp.office365.com
MAIL_PORT=587
MAIL_USERNAME=info@***.com
MAIL_PASSWORD=*******
MAIL_ENCRYPTION=tls


while i am trying to send email i got error like



Failed to authenticate on SMTP server with username "info@omoyyc.com" using 2 possible authenticators. Authenticator LOGIN returned Swift_TransportException: Expected response code 235 but got code "535", with message "535 Incorrect authentication datarn"


my email sending code is as below



Mail::send(array(), array(), function ($m) use ($templatecontent) 
$m->from('customerservice@****.com', 'TEST');
$m->to('test@gmail.com', 'Test')
->subject($templatecontent['subject'])
->setBody($templatecontent['content'], 'text/html');
);


Can anyone guide me what is the issue and how to solve this issue?










share|improve this question














I want to send email using my office365 smtp credentials in laravel application. i have make changes in my .env file for email settings as below:



MAIL_DRIVER=smtp
MAIL_HOST=smtp.office365.com
MAIL_PORT=587
MAIL_USERNAME=info@***.com
MAIL_PASSWORD=*******
MAIL_ENCRYPTION=tls


while i am trying to send email i got error like



Failed to authenticate on SMTP server with username "info@omoyyc.com" using 2 possible authenticators. Authenticator LOGIN returned Swift_TransportException: Expected response code 235 but got code "535", with message "535 Incorrect authentication datarn"


my email sending code is as below



Mail::send(array(), array(), function ($m) use ($templatecontent) 
$m->from('customerservice@****.com', 'TEST');
$m->to('test@gmail.com', 'Test')
->subject($templatecontent['subject'])
->setBody($templatecontent['content'], 'text/html');
);


Can anyone guide me what is the issue and how to solve this issue?







laravel email office365 sendmail






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 14 '18 at 11:12









Adarsh BhattAdarsh Bhatt

199112




199112












  • Have you cleared your cache with php artisan cache:clear?

    – Sven Hakvoort
    Nov 14 '18 at 11:29











  • can you please tell me how to run this command on live server using cpanel. I have set following routes in my web.php to clear cache.Route::get('/config-cache', function() $exitCode = Artisan::call('config:cache'); return '<h1>Clear Config cleared</h1>'; );

    – Adarsh Bhatt
    Nov 14 '18 at 11:58












  • You can run this in the same location as where you run the composer require or composer update commands (I assume local command line?) and then upload all your project files to the server so the updated files are updated on the server too

    – Sven Hakvoort
    Nov 14 '18 at 12:01











  • i am working on live server directly.

    – Adarsh Bhatt
    Nov 14 '18 at 12:02











  • Do you have a terminal/command line interface/open ssh connection to the server? How have you initialized the laravel project?

    – Sven Hakvoort
    Nov 14 '18 at 12:03

















  • Have you cleared your cache with php artisan cache:clear?

    – Sven Hakvoort
    Nov 14 '18 at 11:29











  • can you please tell me how to run this command on live server using cpanel. I have set following routes in my web.php to clear cache.Route::get('/config-cache', function() $exitCode = Artisan::call('config:cache'); return '<h1>Clear Config cleared</h1>'; );

    – Adarsh Bhatt
    Nov 14 '18 at 11:58












  • You can run this in the same location as where you run the composer require or composer update commands (I assume local command line?) and then upload all your project files to the server so the updated files are updated on the server too

    – Sven Hakvoort
    Nov 14 '18 at 12:01











  • i am working on live server directly.

    – Adarsh Bhatt
    Nov 14 '18 at 12:02











  • Do you have a terminal/command line interface/open ssh connection to the server? How have you initialized the laravel project?

    – Sven Hakvoort
    Nov 14 '18 at 12:03
















Have you cleared your cache with php artisan cache:clear?

– Sven Hakvoort
Nov 14 '18 at 11:29





Have you cleared your cache with php artisan cache:clear?

– Sven Hakvoort
Nov 14 '18 at 11:29













can you please tell me how to run this command on live server using cpanel. I have set following routes in my web.php to clear cache.Route::get('/config-cache', function() $exitCode = Artisan::call('config:cache'); return '<h1>Clear Config cleared</h1>'; );

– Adarsh Bhatt
Nov 14 '18 at 11:58






can you please tell me how to run this command on live server using cpanel. I have set following routes in my web.php to clear cache.Route::get('/config-cache', function() $exitCode = Artisan::call('config:cache'); return '<h1>Clear Config cleared</h1>'; );

– Adarsh Bhatt
Nov 14 '18 at 11:58














You can run this in the same location as where you run the composer require or composer update commands (I assume local command line?) and then upload all your project files to the server so the updated files are updated on the server too

– Sven Hakvoort
Nov 14 '18 at 12:01





You can run this in the same location as where you run the composer require or composer update commands (I assume local command line?) and then upload all your project files to the server so the updated files are updated on the server too

– Sven Hakvoort
Nov 14 '18 at 12:01













i am working on live server directly.

– Adarsh Bhatt
Nov 14 '18 at 12:02





i am working on live server directly.

– Adarsh Bhatt
Nov 14 '18 at 12:02













Do you have a terminal/command line interface/open ssh connection to the server? How have you initialized the laravel project?

– Sven Hakvoort
Nov 14 '18 at 12:03





Do you have a terminal/command line interface/open ssh connection to the server? How have you initialized the laravel project?

– Sven Hakvoort
Nov 14 '18 at 12:03












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53298872%2fexpected-response-code-235-but-got-code-535-laravel-send-email-using-office365-s%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53298872%2fexpected-response-code-235-but-got-code-535-laravel-send-email-using-office365-s%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

How to read a connectionString WITH PROVIDER in .NET Core?

Node.js Script on GitHub Pages or Amazon S3

Museum of Modern and Contemporary Art of Trento and Rovereto