Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Problem with SENDMAIL using gmail at work.
Replies: 1   Last Post: May 3, 2011 10:42 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Kevin Hung

Posts: 81
Registered: 12/7/04
Problem with SENDMAIL using gmail at work.
Posted: Mar 28, 2011 11:10 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.