Home > programming > send gmail in matlab

send gmail in matlab


function sendgmail(receiver, subject, content)
% VictorFang.com, 20110908
% GNU Copyright.

% Define these variables appropriately:
mail = 'an.example.email.address@gmail.com'; %Your GMail email address
password = 'testing1234'; %Your GMail password

% Then this code will set up the preferences properly:
setpref(‘Internet’,’E_mail’,mail);
setpref(‘Internet’,’SMTP_Server’,’smtp.gmail.com’);
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’);
props.setProperty(‘mail.smtp.socketFactory.port’,’465′);

% Send the email. Note that the first input is the address you are sending the email to
sendmail(receiver, subject, content)

Advertisements
Categories: programming
  1. No comments yet.
  1. No trackbacks yet.

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

%d bloggers like this: