필터 지우기
필터 지우기

Sending an email from outlook.com using matlab

조회 수: 11 (최근 30일)
Shantanu
Shantanu 2015년 11월 2일
답변: IDN 2022년 1월 11일
I am not able to send an email from outlook.com using matlab, it is giving me an error in sendmail function at line number 171. I have configured my outlook email using setpref function. I have used smtp-mail.outlook.com and 587 port to configure my email.I am looking for a working code to send an email using my outtlook.com email using matlab?

답변 (1개)

IDN
IDN 2022년 1월 11일
Try this
mail = 'sender@mail.com';
Tomail = 'to@mail.com';
password = 'password';
port='587';
setpref('Internet','SMTP_Server','smtp-mail.outlook.com');
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'); If this was previously enabled disable with line below
%props.remove('mail.smtp.socketFactory.class');
props.setProperty('mail.smtp.socketFactory.port',port);
props.setProperty('mail.smtp.starttls.enable', 'true' );
sendmail(Tomail,'Test from MATLAB','Hello! This is a test from MATLAB!')

카테고리

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