Are you able to send the file as it is from the example?1. How do you specify which file to upload and how does it get to the ESP to then attach to the email?
I have embedded this file in the code in CMakelist.txt and component.mk under main/ directory. and used it in example file. You can grasp this pretty easily.
https://docs.espressif.com/projects/esp ... inary-data
Depending upon data, you should be able to play this. Please specify correct info for the attachment.For another bit of my project I am getting the ESP to call a number on event and wanted to play a recorded voice but couldn't work out how to do it.
Code: Select all
"Content-Type: image/image/png;name=esp_logo.png\n"
"Content-Transfer-Encoding: base64\n"
"Content-Disposition:attachment;filename=\"esp_logo.png\"\n");
As far as file is concerned, It doesn't matter unless you provide data(and extension in some cases) properly.
That would be good idea!2. To make it a bit easier to incorporate your example into other projects, instead of using the example_connect() call, adding the individual calls would be easier to follow.
3. Thanks for adding the loop makes sense. As a suggestion, putting it into a separate function would help others to include into their project (e.g. in their project might be detect XYZ then send email). Also would show which variables need to be global as needed in the "connect to SMPT server" as well as the send_email function (could take, to/ from/ message etc. as parameters). Would also show how to deal with it outside/ together with the initialize task.
For now, I would keep the example simple and incorporate only few ideas out of these.
You might very easily modifications and do this in your example.