Sendmail error / Error using ==> sendmail at 168

3 ビュー (過去 30 日間)
Jose Arimateia Barroso Neto
Jose Arimateia Barroso Neto 2013 年 6 月 28 日
コメント済み: German Martinez 2016 年 4 月 26 日
Hi, I have a problem with a script in Matlab. When I run my script: _________________________________________
clear all
clc
mail='*********@gmail.com';
password='*****';
setpref('Internet','E_mail',mail);
setpref('Internet','SMTP_Server','smtp.gmail.com');
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','465');
props.put('mail.smtp.starttls.enable','true');
% Send the email. Note that the first input is the address you are sending the email to
sendmail(mail,'Test from MATLAB','Hello! This is a test from MATLAB!')
________________________________________________
I have the following error message:
_________________________________________________
??? Error using ==> sendmail at 168 Exception reading response; sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Error in ==> test_gmail at 18 sendmail(mail,'Test from MATLAB','Hello! This is a test from MATLAB!') ____________________________________________
Anybody can help me? Does anyone know how to troubleshoot this?

採用された回答

Henrique
Henrique 2013 年 7 月 2 日
I just disabled the antivirus and it worked like a charm!
  2 件のコメント
Jose Arimateia Barroso Neto
Jose Arimateia Barroso Neto 2013 年 7 月 2 日
I never imagined that this would be the problem. Thank you.
German Martinez
German Martinez 2016 年 4 月 26 日
Hi!
Can we now what program uses matlab to send the email, and add it then to the antivirus exclusions? Disable the antivirus is dangerous and also it's difficult to do it from matlab.
Kind regards
German

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

その他の回答 (0 件)

カテゴリ

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