我想在Matlab中通过SMTP发送电子邮件。本指南是入门的良好起点:
https://nl.mathworks.com/help/matlab/import_export/sending-email.html
它归结为以下代码行(在2016b中测试):
setpref('Internet','E_mail','[email protected]');
setpref('Internet','SMTP_Server','mail.server.network');
sendmail('[email protected]','Hello From MATLAB!','body text here');
但是,默认SMTP不支持HTML。我尝试了以下方法:
sendmail('[email protected]','Hello From MATLAB!','<strong style="color:red">HTML test</strong>');
如何启用HTML?设置某些首选项/编码是否简单?
参考:https://www.mathworks.com/help/matlab/ref/sendmail.html
sendmail函数不支持HTML格式的消息。但是,您可以将HTML文件作为附件发送。
我想你需要通过支持增强功能来提高它。