フィルターのクリア

Sendmail authentication error with gmail

12 ビュー (過去 30 日間)
Erin
Erin 2015 年 7 月 8 日
コメント済み: Tom 2022 年 6 月 1 日
Here is my code:
myaddress = 'example@gmail.com';
mypassword = 'example';
setpref('Internet','E_mail',myaddress);
setpref('Internet','SMTP_Server','smtp.gmail.com');
setpref('Internet','SMTP_Username',myaddress);
setpref('Internet','SMTP_Password',mypassword);
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','465');
sendmail(toexample@cornell.edu,'email subject test',...
'this email is a test','D:\testimagetosend.tif')
And here is the error message: Error using sendmail (line 171) Authentication failed.
From everything else I have read, the preferences and properties required for gmail are all taken care of, but still getting the error.
  5 件のコメント
Manikandan Prabakaran
Manikandan Prabakaran 2018 年 9 月 13 日
Mr.Bruno's solution works fine. Thanks a lot sir.
machhindra bhamare
machhindra bhamare 2019 年 2 月 26 日
thanks

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

回答 (2 件)

Walter Roberson
Walter Roberson 2015 年 8 月 8 日
Within the last 8 months, Google turned off default support for an older less-secure authentication. You can re-enable it on your account... for now.
  4 件のコメント
Shae Morgan
Shae Morgan 2020 年 10 月 8 日
I'd like to add that if your use seems suspicious to google, it'll still fail the authentication attempt as suspicious activity.
Not sure how to work around this.
Tom
Tom 2022 年 6 月 1 日
As of March 2022 Google has disabled this completely :/

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


Pankaj
Pankaj 2016 年 4 月 14 日
編集済み: Pankaj 2016 年 4 月 14 日
For some service providers the extension ' @gmail.com' in myaddress may cause authentication error. Simply use userID.

カテゴリ

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