How to use sendmail on macOS (Matlab 2017a)?

2 visualizzazioni (ultimi 30 giorni)
Martin Strambach
Martin Strambach il 25 Ott 2017
Risposto: Ramtin Jafari il 2 Dic 2017
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?

Risposte (1)

Ramtin Jafari
Ramtin Jafari il 2 Dic 2017
I have exactly the same issue!

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by