Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
|
|
Problem with SENDMAIL using gmail at work.
Posted:
Mar 28, 2011 11:10 AM
|
|
I used the following example code from Matlab doc at work (have not tried this out at home yet):
% Modify these two lines to reflect % your account and password. myaddress = '.....'; 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.');
But I got this error message:
??? Error using ==> sendmail at 168 Could not connect to SMTP host: smtp.gmail.com, port: 25; Connection refused: connect
Error in ==> do_tmp at 17 sendmail(myaddress, 'Gmail Test', 'This is a test message.');
Does this mean that this won't work in my office?
Thanks
|
|
|
|