displaying a date variable in an email

3 ビュー (過去 30 日間)
AA
AA 2016 年 7 月 30 日
コメント済み: Azzi Abdelmalek 2016 年 7 月 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'});

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 7 月 30 日
DATE='23.03.1955'
sendmail('XXXXX@gmail.com',Date,'Test message','XXX.jpg');
  3 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2016 年 7 月 30 日
Ok, how does this variable change?
Azzi Abdelmalek
Azzi Abdelmalek 2016 年 7 月 30 日
If the date is the current date, write:
Date=datestr(now,'dd.mm.yyyy')

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLanguage Fundamentals についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by