sending E-mail error
显示 更早的评论
Türk:
Merhaba;
MATLAB ile e-posta göndermek istiyorum ama bu kodları buldum (Sendmail kullanarak hata (satır 172)
İstisna okuma cevabı;
sun.security.validator.ValidatorException: PKIX yolu oluşturulamadı: sun.security.provider.certpath.SunCertPathBuilderException: geçerli bulunamıyor
istenen hedefe yönelik sertifika yolu
Bu hatayla karşılaştığım sorun nedir?
Teşekkürler...
English:
Hi;
I want to send e-mail with MATLAB but I found these codes (Error using sendmail (line 172)
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 )
What's the problem I'm having with this error?
Thanks...
%
% parameters
mail = 'mymail@gmail.com'; % my gmail address
password = 'mypassword'; % my gmail password
host = 'smtp.mail.com';
% preferences
setpref('Internet','SMTP_Server', host);
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','465');
% Send the email
sendmail(mail,'Test from MATLAB','Hello! This is a test from MATLAB!')
2 个评论
cem sare
2018-11-30
mark filan
2019-7-31
Enabling access for "less secure apps" means that the client/app doesn't use OAuth 2.0 . OAuth 2.0 is the industry-standard protocol for authorization. When you sign in with OAuth 2.0, you sign in to Google's system directly. In OAuth 2.0 , you authenticate directly to Gmail with your credentials and authorize an app to do certain things. The third-party app only sees an authorization token provided by Google as proof that you authenticated correctly and agreed to authorize that app.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Web Services 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!