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';
server = 'smtp.server.net';
props = java.lang.System.getProperties;
props.setProperty('mail.smtp.port','587');
setpref('Internet','E_mail',mail);
setpref('Internet','SMTP_Server',server);
setpref('Internet','SMTP_Username',mail);
setpref('Internet','SMTP_Password',password);
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.