displaying a date variable in an email

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'});

 Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 30 de Jul. de 2016
DATE='23.03.1955'
sendmail('XXXXX@gmail.com',Date,'Test message','XXX.jpg');

3 comentarios

AA
AA el 30 de Jul. de 2016
noo, the variable will change. one day it will be 23.03.1955. other times it will be 24.06. 2017. How can I incorporate a variable nito this?
Azzi Abdelmalek
Azzi Abdelmalek el 30 de Jul. de 2016
Ok, how does this variable change?
If the date is the current date, write:
Date=datestr(now,'dd.mm.yyyy')

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Etiquetas

Preguntada:

AA
el 30 de Jul. de 2016

Comentada:

el 30 de Jul. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by