필터 지우기
필터 지우기

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 CenterFile Exchange에서 Web Services에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by