필터 지우기
필터 지우기

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 CenterFile Exchange에서 Web Services에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by