People have used different methods over the years to have MATLAB alert them when MATLAB is done with a long set of calculations from playing a sound file, to sending an e-mail, or now sending a text to your cell phone.
This is a nice little mash-up that uses SENDMAIL to send mail to your Google Gmail account with the right formatting that tells Google to send the text for you.
Video Content
This is a well written piece of code with nice help and good examples. How will you use this, I would love to hear the story. Click here to download it.
This is really cool, but entering a password in plain text into a file is a really bad security risk; particularly if that file has the word “password” on the same line. Yikes! Makes for a good target via an automatic file search.
It would be better if the password was encrypted somehow. For example, a MATLAB GUI could prompt you for your email and password. Then that GUI could twiddle the password with some a reversible operation and then that password could be saved in a MATLAB *.mat file. At least that would make it hard for a non-MATLAB savvy hacker, or virus, to sniff out the password.
Then, in addition, the m-file here should not use the variable name “password” or use the word “password” in any comments.
I’m sure there are better techniques – Java, via MATLAB, can do encryption and decryption, for example.
If you know an SMTP server which doesn’t require login (you company may provide you one), you can use that to avoid the password line. If you don’t know any SMTP server, you can install one free on your own computer: http://www.softstack.com/freesmtp.html.
To use your own (or your company’s) SMTP server, delete the following lines:
password = ‘xxxxxxxxx’;
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′);
and change the following line:
setpref(‘Internet’,'SMTP_Server’,'smtp.gmail.com’);
to your own server. If you use that program I mentioned above, use ’127.0.0.1′ instead of ‘smtp.gmail.com’. Then you won’t need any password.
Leave a Reply
About
Brett & Jiro share their favorite user-contributed submissions from the File Exchange.
This is really cool, but entering a password in plain text into a file is a really bad security risk; particularly if that file has the word “password” on the same line. Yikes! Makes for a good target via an automatic file search.
It would be better if the password was encrypted somehow. For example, a MATLAB GUI could prompt you for your email and password. Then that GUI could twiddle the password with some a reversible operation and then that password could be saved in a MATLAB *.mat file. At least that would make it hard for a non-MATLAB savvy hacker, or virus, to sniff out the password.
Then, in addition, the m-file here should not use the variable name “password” or use the word “password” in any comments.
I’m sure there are better techniques – Java, via MATLAB, can do encryption and decryption, for example.
Tim,
An excellent thought. Anyone made a little encryption routine for MATLAB? If not, this GUI that I promoted earlier:
http://blogs.mathworks.com/pick/2007/10/05/masking-typed-passwords-with-asterisks/
might be helpful!
Thanks,
Doug
If you know an SMTP server which doesn’t require login (you company may provide you one), you can use that to avoid the password line. If you don’t know any SMTP server, you can install one free on your own computer:
http://www.softstack.com/freesmtp.html.
To use your own (or your company’s) SMTP server, delete the following lines:
password = ‘xxxxxxxxx’;
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′);
and change the following line:
setpref(‘Internet’,'SMTP_Server’,'smtp.gmail.com’);
to your own server. If you use that program I mentioned above, use ’127.0.0.1′ instead of ‘smtp.gmail.com’. Then you won’t need any password.