displaying a date variable in an email
2 次查看(过去 30 天)
显示 更早的评论
I got a variable DATE=23.03.1955 in Matlab. I want this variable to be displayed in the subject field of the email or the text message. Please help
if true
% code
end
saveas( gcf, 'XXX', 'jpg' );
UserName = 'XXX@gmail.com';
passWord = 'XXX';
setpref('Internet','E_mail',UserName);
setpref('Internet','SMTP_Server','smtp.gmail.com');
setpref('Internet','SMTP_Username',UserName);
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('XXXXX@gmail.com',...
'XXX','Test message',...
{'XXX.jpg'});
0 个评论
采纳的回答
Azzi Abdelmalek
2016-7-30
DATE='23.03.1955'
sendmail('XXXXX@gmail.com',Date,'Test message','XXX.jpg');
3 个评论
Azzi Abdelmalek
2016-7-30
If the date is the current date, write:
Date=datestr(now,'dd.mm.yyyy')
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!