How to send an email using MATLAB? How to check internet connection in MATLAB?

Video explains how to send email through MATLAB. In this video it explains to configure the MALTAB with the gmail/ google SMTP server. This video also shows how to test the internet connection from within MATLAB.

We will be glad to hear from you regarding any query, suggestions or appreciations at: programmerworld1990@gmail.com

Source code:

% SendEmail

setpref(‘Internet’,’SMTP_Server’,’smtp.gmail.com’);
setpref(‘Internet’,’E_mail’,’abcd@gmail.com’); % Need to give the email ID

props = java.lang.System.getProperties;
props.setProperty(‘mail.smtp.auth’,’true’);
props.setProperty(‘mail.smtp.starttls.enable’,’true’);

setpref(‘Internet’,’SMTP_Username’,’abcd@gmail.com’); % Need to give the email ID
setpref(‘Internet’,’SMTP_Password’,’**********’); % Need to give the password

sendmail(‘abcd@gmail.com’, ‘MATLAB Test’, ‘Test Email’)

2 comments

Leave a Reply

%d bloggers like this: