如何使用matlab发送html格式邮件

如何使用matlab发送html格式邮件

ID:25062604

大小:90.74 KB

页数:11页

时间:2018-11-17

如何使用matlab发送html格式邮件_第1页
如何使用matlab发送html格式邮件_第2页
如何使用matlab发送html格式邮件_第3页
如何使用matlab发送html格式邮件_第4页
如何使用matlab发送html格式邮件_第5页
资源描述:

《如何使用matlab发送html格式邮件》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、Matlab发送html格式邮件Matlab是非常优秀的数据分析软件,具有很多优秀的功能,比如发送邮件。但是matlab自带的sendmail不支持html方式发送邮件正文,有时候非常不方便。查询可知matlab的sendmail和java的javax.mailpackage有密切关系,可以通过修改原函数的部分参数,扩展后就可以发送带html格式正文的邮件了。先截图看下效果:修改的部分为:将原函数的119-130行改为下图所示:修改前修改后此外将maxLineLength=75;改为maxLineLength=inf;然后再按照原来函数的用法发送邮件就可以了。做法来源于:

2、http://undocumentedmatlab.com/blog/sending-html-emails-from-matlab。附件自带本人修改后的函数,可以复制下到matlab创建函数直接使用。注意:使用sendmail函数发送邮件之前需要先进行设置,具体可以参考matlab说明。functionsendmail(to,subject,theMessage,attachments)%SENDMAILSende-mail.%SENDMAIL(TO,SUBJECT,MESSAGE,ATTACHMENTS)sendsane-mail.TOiseithera%charac

3、tervectorspecifyingasingleaddress,oracellarrayofcharactervector%addresses.SUBJECTisacharactervector.MESSAGEiseitheracharactervectororacell%arrayofcharactervectors.Ifitisacharactervector,thetextwill%automaticallywrapat75characters.Ifitisacellarray,itwon'twrap,but%eachcellstartsanewline.Ine

4、ithercase,usechar(10)toexplicitlyspecify%anewline.ATTACHMENTSisacharactervectororacellarrayofcharacter%vectorslistingfilestosendalongwiththemessage.OnlyTOandSUBJECTare%required.%%SENDMAILreliesontwopreferences,"Internet:SMTP_Server",yourmailserver,and%"Internet:E_mail",youre-mailaddress.U

5、seSETPREFtosetthesebeforeusing%SENDMAIL.Theeasiestwaystoidentifyyouroutgoingmailserveristolookat%thepreferencesofanothere-mailapplicationorconsultyouradministrator.If%youcannotfindoutyourserver'sname,settingittojust'mail'mightwork.If%youdonotsetthesepreferencesSENDMAILwilltrytodetermineth

6、em%automaticallybyreadingenvironmentvariablesandtheWindowsregistry.%%Example:%setpref('Internet','SMTP_Server','mail.example.com');%setpref('Internet','E_mail','matt@example.com');%sendmail('user@example.com','Calculationcomplete.')%sendmail({'matt@example.com','peter@example.com'},'You''

7、recool!',...%'Seetheattachedfilesformoreinfo.',{'attach1.m','d:attach2.doc'});%sendmail('user@example.com','Addingadditionalbreaks',['one'10'two']);%sendmail('user@example.com','Specifyingexactlines',{'one','two'});%%SeealsoWEB,FTP.%Copyright1984-2016TheMathWorks,I

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。