Problem with :: Error using sendmail (line 171) Authentication failed.-- Please Help me
이전 댓글 표시
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
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개)
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
2015년 7월 20일
0 개 추천
댓글 수: 5
Samuel Bland
2018년 4월 2일
I had been using sendmail() since forever and it worked fine. I had to change the email address and then I got the authentication failed error message. The answer by Majd Dw solved this problem for me. Also, make sure to go to your gmail privacy settings and allow less secure access if necessary.
Bradley Stiritz
2018년 9월 15일
sendmail() was also working fine for me, and then suddenly stopped working. Now I always get "authentication failed".
I tried setting the Matlab Web Preferences per Majd Dw above. (Previously all the values were blank) In my case, clicking the "Test Connection" button generated the message "Failed!"
I'm not sure where to go from here? I have already done the following in Gmail Settings--
- Made sure "2-Step Verification" is off
- Made sure "Less Secure App Access" is on
- Enabled POP and IMAP
Does anyone have any further thoughts, please?
Shae Morgan
2020년 10월 8일
Even if you enable less secure apps, it'll fail the authentication if the account is viewed as suspicious activity. I'm not sure how to get around it yet, but I'm dealing with the same issue
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
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
카테고리
도움말 센터 및 File Exchange에서 Web Services에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
