How to use sendmail on macOS (Matlab 2017a)?
2 views (last 30 days)
Show older comments
Hi,
I'm trying to send an email using sendmail function. Following setup works perfectly fine on Windows 10, but I'm unable to make it work on macOS Sierra.
mail = 'email@yahoo.com';
password = 'password';
setpref('Internet','SMTP_Server','smtp.mail.yahoo.com');
setpref('Internet','E_mail',mail);
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');
sendmail(mail, 'My message', 'My message');
On macOS it throws following error.
Error using sendmail (line 169)
501 5.5.4 Invalid argument
Does anyone have an idea how to solve it?
0 Comments
Answers (1)
See Also
Categories
Find more on Web Services in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!