Sendmail in Matlab

扶醉桌前 提交于 2019-12-25 01:12:32

问题


I am developing a Matlab code to send mails through Microsoft outlook (code below). When I run the code, it shows no errors. However, the mail is not delivered to the recipient either. Version - R2014a. Is there any problem with the SMTP server address or SMTP port number? I have taken the server address and port number from the IT admin. So, there should be no issue regarding those two things. What should I do?

Setpref (‘Internet’,’E_mail’,’yourmailid@mailserver.com’);
Setpref (‘Internet’,’SMTP_Username’,’yourmailid@mailserver.com’);
Setpref (‘Internet’,’SMTP_Password’,’yourpassword’);
Setpref (‘Internet’,’SMTP_Server’,‘smtp-mail.mailserver.com’);
Props=java.lang.System.getproperties;
Props.setProperty (‘mail.smtp.auth’,’true’);
Props.setproperty(‘mail.smtp.socketFactory.class’,’javax.net.ssl.SSLSocketFactory.port’);
Props.setProperty(‘mail.smtp.socketFactory.port’,’25’);
Sendmail(‘recipientmailid@recipientserver.com’,’Mail from Matlab’,’your message body’);

来源:https://stackoverflow.com/questions/27266890/sendmail-in-matlab

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!