Created
September 25, 2021 22:15
-
-
Save kevduc/e89e9c82ff9d7d7308233886e27a6123 to your computer and use it in GitHub Desktop.
Example to send an email in MATLAB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myaddress = '[email protected]'; | |
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.'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment