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 CenterFile Exchange에서 Language Fundamentals에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by