Friday, October 7, 2011

Matlab Gmail

Matlab can send an email (maybe can't make a call, though). Here is how to do it with Gmail. I've just played with this and checked this works. Still don't know when to use it, though. (this is supposed to be used by people who work on long simulation)

-----------------------------------------------------------------------------------

% Define these variables appropriately:
mail_address = 'linli@obasic.net';            % My E-Mail Address
user_name = 'linli';                          % My Username
password = 'likeiwilltellyoumypassword';      % My E-Mail Password
smtp_server = 'mail.obasic.net;               % My SMTP Server
 
% Then this code will set up the preferences properly:
setpref('Internet', 'E_mail', mail_address);
setpref('Internet', 'SMTP_Username', user_name);
setpref('Internet', 'SMTP_Password', password);
setpref('Internet', 'SMTP_Server', smtp_server);
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');

-----------------------------------------------------------------------------------
(copy from the link)

http://www.mathworks.fr/help/techdoc/import_export/f5-136211.html
http://obasic.net/how-to-send-e-mail-from-matlab