{Msd Academy}

READ IN MY NEW BLOG WITH UPDATES!
To send mail via matlab we need to tell to matlab our username,password,server etc. To doing this enter the following codes and modify it, it is just an example.

% Modify these two lines to reflect
% your account and password.
myaddress = ‘myaddress@gmail.com’;
mypassword = ‘mypassword’;

setpref(‘Internet’,’E_mail’,myaddress);
setpref(‘Internet’,’SMTP_Server’,’smtp.gmail.com’);
setpref(‘Internet’,’SMTP_Username’,myaddress);
setpref(‘Internet’,’SMTP_Password’,mypassword);

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′);

sendmail(myaddress, ‘Gmail Test’, ‘This is a test message.’);

View original post

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s