cannot send an email through matlab

4 ビュー (過去 30 日間)
Mario Trevino
Mario Trevino 2019 年 5 月 3 日
コメント済み: Adam Danz 2019 年 5 月 3 日
Im not being able to send an email thgourh matlab.... My google account allow external applications to use it....
here is the code.... any suggestions?
------------------------------
username='myemail';
password='mypassword';
setpref('Internet', 'SMTP_Server', 'smtp.gmail.com');
setpref('Internet','E_mail',username);
setpref('Internet', 'SMTP_Username', username);
setpref('Internet', 'SMTP_Password', password);
props = java.lang.System.getProperties;
props.setProperty('mail.smtp.auth', 'true'); % Note: 'true' as a string, not a logical value!
props.setProperty('mail.smtp.starttls.enable', 'true'); % Note: 'true' as a string, not a logical value!
props.setProperty('mail.smtp.socketFactory.port', '465'); % Note: '465' as a string, not a numeric value!
props.setProperty('mail.smtp.socketFactory.class', 'javax.net.ssl.SSLSocketFactory');
sendmail('another@email', 'Hello world')
------------------------------

採用された回答

Adam Danz
Adam Danz 2019 年 5 月 3 日
編集済み: Adam Danz 2019 年 5 月 3 日
Mario, follow this demo on how to send an email from a gmail account using matlab. You're close - you just have to make some small adjustment.
Feel free to leave a comment if you get stuck.
  5 件のコメント
Mario Trevino
Mario Trevino 2019 年 5 月 3 日
OK found the problem.. it was my AVAST antivirus protection.
thank you very much!
Adam Danz
Adam Danz 2019 年 5 月 3 日
Ah, this is also a common problem. I'll update that post to mention this. Thanks for following up!

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by