필터 지우기
필터 지우기

How do I use SENDMAIL to send email from a SMTP server that uses authorization in MATLAB 7.10 (R2010a)?

조회 수: 21 (최근 30일)
I would like to send an email using a server that requires authorization. However, this server does not support SSL. How can I do this?

채택된 답변

MathWorks Support Team
MathWorks Support Team 2013년 9월 30일
To send an email from a non-SSL SMTP server that requires authorization, please use the code below.
Make sure to substitute your actual email address, password, and SMTP server information in the first three lines of code. Contact your local technical support department to determine the address of your SMTP server.
mail = 'myemail@address.com; % Replace with your email address
password = 'l1ll1put'; % Replace with your email password
server = 'smtp.server.net'; % Replace with your SMTP server
props = java.lang.System.getProperties;
props.setProperty('mail.smtp.port','587');
% Apply prefs and props
setpref('Internet','E_mail',mail);
setpref('Internet','SMTP_Server',server);
setpref('Internet','SMTP_Username',mail);
setpref('Internet','SMTP_Password',password);
% Send the email
sendmail('receiver@email.com', 'Test', 'Msg from MATLAB');
Note that the above commands are undocumented and may change in future MATLAB releases, but they were last verified in MATLAB 8.2 (R2013b). Also, note that SENDMAIL does not support servers that require username and password authentications in MATLAB 7.1 (R14SP3) and before, and hence the above commands will not work with those releases.

추가 답변 (0개)

카테고리

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

태그

아직 태그를 입력하지 않았습니다.

제품


릴리스

R2013b

Community Treasure Hunt

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

Start Hunting!

Translated by