Matlab
%%%%%%%%%%%%%%%%Talk is cheap, show ur guys the code%%%%%%%%%
function mailme(i)
%更改123修改发送邮箱
% 账号设置
mail = '发送邮箱'; % ①邮箱地址
password = '在邮箱官网找到授权码'; % ②密码
% 服务器设置
setpref('Internet','E_mail',mail);
setpref('Internet','SMTP_Server','smtp.126.com'); % ③SMTP服务器
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');
% 收件人
receiver='接收邮箱';
% 邮件标题&内容
switch i
case 1
mailtitle='你的1D双温模型matlab代码跑完啦!!!';
case 2
mailtitle='你的2D双温模型matlab代码跑完啦!!!';
case 3
mailtitle='你的3D双温模型matlab代码跑完啦!!!';
otherwise
mailtitle='你的双温模型matlab代码跑完啦!!!';
end
% 邮件内容
mailcontent=['mission compeleted!'];
% 发送
sendmail(receiver, mailtitle, mailcontent);
end