フィルターのクリア

Sendmail 'Authentication failed' error at office365.com

34 ビュー (過去 30 日間)
Rob Campbell
Rob Campbell 2022 年 2 月 8 日
回答済み: Mehmet Ali 2023 年 10 月 3 日
Hi all:
I'm trying to configure sendmail to send me an email when something breaks. I am having a hard time getting it to work with Office365.com. I've been up and down the web and have found similar problems (with gmail, not office365) and have been learning a lot about java email settings, but have not been successful.
I have verified that I'm seeing the server, I get replies when I ping and see the server when I telnet over to smtp.office365.com. I set up the account on Thunderbird and it sends mail just fine. I've verified that 'authorized SMTP' is enabled at office365.com. Running out of ideas on what else to try or how else to debug.
Here is what I am using:
mail = 'name@domain.org';
password = 'xxx';
server = 'smtp.office365.com';
port = '587';
setpref('Internet','E_mail', mail);
setpref('Internet','SMTP_Server', server);
setpref('Internet','SMTP_Username', mail);
setpref('Internet','SMTP_Password', password);
props = java.lang.System.getProperties;
props.setProperty( 'mail.smtp.ssl.trust', server);
props.setProperty( 'mail.smtp.user', mail );
props.setProperty( 'mail.smtp.password', password );
props.setProperty( 'mail.smtp.host', server );
props.setProperty( 'mail.smtp.port', port );
props.setProperty( 'mail.smtp.starttls.enable', 'true' );
props.setProperty( 'mail.smtp.auth', 'true' );
sendmail('recipent@domain.org','Subject','Message')
It returns:
Error using sendmail (line 175)
Authentication failed.
Anyone have any ideas or thoughts on how to debug?
Thanks, Rob
  3 件のコメント
Markus Hohlagschwandtner
Markus Hohlagschwandtner 2022 年 11 月 11 日
I have exact the same problem in MATLAB 2022b.
Markus Hohlagschwandtner
Markus Hohlagschwandtner 2022 年 11 月 26 日
I found the problem. SMTP AUTH hast to be disabled.
props.setProperty( 'mail.smtp.auth', 'false' );

サインインしてコメントする。

回答 (1 件)

Mehmet Ali
Mehmet Ali 2023 年 10 月 3 日
When I am using this code I am getting an error :
Error using sendmail
530 5.7.57 Client not authenticated to send mail. [VI1PR0102CA0080.eurprd01.prod.exchangelabs.com
2023-10-03T15:12:54.961Z 08DBC367B59984EF]
Do you have any suggestion for this?

カテゴリ

Help Center および File ExchangeWeb Services についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by