필터 지우기
필터 지우기

Send Email from Matlab 2012 (Error)

조회 수: 2 (최근 30일)
Manikandan VM
Manikandan VM 2016년 4월 8일
편집: Manikandan VM 2016년 4월 8일
I am trying to send email from matlab 2012 using the following code. I just want to send a mail from my account to myself. But I am getting an error message.
mail = 'mygmail@gmail.com'; %Your GMail email address
password = 'mypassword'; %Your GMail password
Then this code will set up the preferences properly:
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');
Send email. The first argument is recipient.
sendmail('mymail@gmail.com','Test from MATLAB','Hello! This is a test from MATLAB!')
Error message :
Error using sendmail (line 164)
Authentication failed.
Error in email (line 15)
sendmail('mygmail@gmail.com','Test from MATLAB','Hello! This is a test
from MATLAB!')

채택된 답변

Walter Roberson
Walter Roberson 2016년 4월 8일
https://support.google.com/accounts/answer/6010255?hl=en

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Web Services에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by