Hello Sara
I too get this error message
please find below the complete error code
home/hyperion/Arduino/Sample_Picture_send/Sample_Picture_send.ino: In function ‘void smtpCallback(SMTP_Status)’:
Sample_Picture_send:272:27: error: ‘SMTP_Result {aka struct esp_mail_smtp_send_status_t}’ has no member named ‘timesstamp’
localtime_r(&result.timesstamp, &dt); // changed from timesstamp
^
exit status 1
‘SMTP_Result {aka struct esp_mail_smtp_send_status_t}’ has no member named ‘timesstamp’
I’m definitely using ESP Mail Client 1.3.0 as it is a fresh installation of the IDE 1.8.16
if I change line 272 timesstamp to be timestamp I get a completely different error message as follows
/home/hyperion/Arduino/Sample_Picture_send/Sample_Picture_send.ino: In function ‘void smtpCallback(SMTP_Status)’:
Sample_Picture_send:272:41: error: invalid conversion from ‘uint32_t* {aka unsigned int*}’ to ‘const time_t* {aka const long int*}’ [-fpermissive]
localtime_r(&result.timestamp, &dt); // changed from timesstamp
^
In file included from /home/hyperion/.arduino15/packages/esp32/hardware/esp32/1.0.6/tools/sdk/include/newlib/stdio.h:29:0,
from /home/hyperion/.arduino15/packages/esp32/hardware/esp32/1.0.6/cores/esp32/Arduino.h:27,
from sketch/Sample_Picture_send.ino.cpp:1:
/home/hyperion/.arduino15/packages/esp32/hardware/esp32/1.0.6/tools/sdk/include/newlib/time.h:69:12: note: initializing argument 1 of ‘tm* localtime_r(const time_t*, tm*)’
struct tm *_EXFUN(localtime_r, (const time_t *__restrict,
^
exit status 1
invalid conversion from ‘uint32_t* {aka unsigned int*}’ to ‘const time_t* {aka const long int*}’ [-fpermissive]
with the arrow pointing to the &dt e.g. in that it likes &result.timestamp
?? do you have any ideas as to what is happening??
I’m using IDE 1.8.16
? which version do you use to develop the code maybe there is another factor creeping in
Kind regards
vin
Hi.
It seems an issue related to the library version.
Try using version 1.3.3. It’s the version that I’m using at the moment.
Then, tell me if that solves the issue. If not, I will take a deep look at this.
Regards,
Sara
hi sara
I’ve upgraded the version of esp mail to 1.3.3 a fairly simple process…
seems to have the same problem
please find below
TIMESSTAMP
/home/hyperion/Arduino/Sample_Picture_send/Sample_Picture_send.ino: In function ‘void smtpCallback(SMTP_Status)’:
Sample_Picture_send:272:27: error: ‘SMTP_Result {aka struct esp_mail_smtp_send_status_t}’ has no member named ‘timesstamp’
localtime_r(&result.timesstamp, &dt); // changed from timesstamp
^
exit status 1
‘SMTP_Result {aka struct esp_mail_smtp_send_status_t}’ has no member named ‘timesstamp’
again I’ve changed timesstamp to timestamp ( as it looks as if its a typo anyway)
and again I get the same error message as before in that the system likes the structure member of session.timestamp but doesn’t like the type casting of &dt
sorry its very verbose
TIMESSTAMP ->TIMESTAMP
home/hyperion/Arduino/Sample_Picture_send/Sample_Picture_send.ino: In function ‘void smtpCallback(SMTP_Status)’:
Sample_Picture_send:272:41: error: invalid conversion from ‘uint32_t* {aka unsigned int*}’ to ‘const time_t* {aka const long int*}’ [-fpermissive]
localtime_r(&result.timestamp, &dt); // changed from timesstamp
^
In file included from /home/hyperion/.arduino15/packages/esp32/hardware/esp32/1.0.6/tools/sdk/include/newlib/stdio.h:29:0,
from /home/hyperion/.arduino15/packages/esp32/hardware/esp32/1.0.6/cores/esp32/Arduino.h:27,
from sketch/Sample_Picture_send.ino.cpp:1:
/home/hyperion/.arduino15/packages/esp32/hardware/esp32/1.0.6/tools/sdk/include/newlib/time.h:69:12: note: initializing argument 1 of ‘tm* localtime_r(const time_t*, tm*)’
struct tm *_EXFUN(localtime_r, (const time_t *__restrict,
^
exit status 1
invalid conversion from ‘uint32_t* {aka unsigned int*}’ to ‘const time_t* {aka const long int*}’ [-fpermissive]
hmmmmmmm
may I ask which version of Arduino IDE you are using because something strange is occurring here I think
KInd regards
vin
Hi Sara,
Found it.
Somehow the code that I downloaded has a missing line and and inserted line.
localtime_r(&result.timesstamp, &dt); //is what is downloaded with a typo for timestamp hence a previous user reported a similar issue with .timesstamp not being recognised.
this ( or something similar) is what it should be
time_t ts = (time_t)result.timestamp;
localtime_r(&ts, &dt);
well at least it now compiles, and I can investigate what values are passed through.
Kind regards
vin