How to send SMS using gmail account?
1 view (last 30 days)
Show older comments
i tried with the following code by repaling my gmail account and passord and also with receiver gmail account.
setpref('Internet','E_mail','MygmailAccount');
setpref('Internet','SMTP_Server','smtp.gmail.com');
setpref('Internet','SMTP_Username','MygmailAccount');
setpref('Internet','SMTP_Password','MyGmailPassword');
props = java.lang.System.getProperties;
props.setProperty('mail.smtp.auth','true');
props.setProperty('mail.smtp.starttls.enable','true');
props.setProperty('mail.smtp.socketFactory.class','javax.net.ss1.SSLSocketFactory');
props.setProperty( 'mail.smtp.socketFactory.port', '587' );
emailto = 'ReceiverGmailAccount'; % recipient's email
sendmail(emailto, 'matlab', 'welcome to the matlab world');
But getting the following error
Error using sendmail (line 171)
Could not connect to SMTP host: smtp.gmail.com, port: 25;
Connection timed out: connect
Error in emailsending (line 14)
sendmail(emailto, 'matlab', 'welcome to the matlab world');
Can someone help on this..thanking you in advance
0 Comments
Answers (0)
See Also
Categories
Find more on Web Services in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!