Problem with :: Error using sendmail (line 171) Authentication failed.-- Please Help me

14 ビュー (過去 30 日間)
Majd Dw
Majd Dw 2015 年 7 月 20 日
コメント済み: Walter Roberson 2020 年 12 月 23 日
Hello Please I need your Help:
I tried to start this code
mail = 'user@service.com';
password = 'passwordgoeshere';
setpref('Internet','SMTP_Server','smtp.server.com');
setpref('Internet','E_mail',mail);
setpref('Internet','SMTP_Username',mail);
setpref('Internet','SMTP_Password',password);
props = java.lang.System.getProperties;
props.setProperty('mail.smtp.auth','true');
props.setProperty('mail.smtp.socketFactory.class', 'javax.net.ssl.SSLSocketFactory');
props.setProperty('mail.smtp.socketFactory.port',port);
sendmail(mail,'Test from MATLAB','Hello! This is a test from MATLAB!')
I have this Problem Error using sendmail (line 171) Authentication failed.
I know the Problem with the Web- Preferences of Matlab i tried with Proxy host 172.16.10.8 and Port 22 it is not Success...
Please How i can find right Proxy host and Proxy Port ??
Thank you
  1 件のコメント
Jan
Jan 2015 年 7 月 20 日
Hm. I've answered this question already some minutes ago. If you post a question in different forums, please add a link to the other thread, such that the readers do not waste the time to post answers, which have been given before already.
Please use the "{} Code" button to format your code.

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

回答 (3 件)

Jan
Jan 2015 年 7 月 20 日
編集済み: Jan 2015 年 7 月 20 日
Just to be sure: Did you adjust these lines accordingly:
mail = 'user@service.com';
password = 'passwordgoeshere'
?!
The right Proxy host and Proxy Port are provided by your Email service and the forum cannot guess this.

Majd Dw
Majd Dw 2015 年 7 月 20 日
Hello Jan,
I use gmail Server so the port is 465 and the proxy host is smtp.gmail.com I have the same Problem Error using sendmail (line 171) Authentication failed.

Majd Dw
Majd Dw 2015 年 7 月 20 日
Jan i wi
ll show you in this Dialog. we have to put the proxy and the port
  5 件のコメント
Vitor Higuti
Vitor Higuti 2020 年 12 月 22 日
In my case, I was running the script with sendmail on remote pc. After I logged in gmail account via browser (it asked to provide the security code), I did not get the authentication error anymore and the email with sendmail went through.
Walter Roberson
Walter Roberson 2020 年 12 月 23 日
For gmail specifically, you need to enable "Less secure app access" on gmail; https://support.google.com/accounts/answer/6010255?hl=en

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by