Search found 92 matches

by leenowell
Sat Feb 08, 2020 11:24 am
Forum: ESP-IDF
Topic: ESP32 IDF smtp (Simple Mail Transfer Protocol) support
Replies: 22
Views: 23011

Re: ESP32 IDF smtp (Simple Mail Transfer Protocol) support

@ESP_Vikram Thanks very much for your reply. Will take a look at the error messages but the odd thing is that this only seems to occur when you make the ssl a global variable and separate the code for sending email into a different function from the SMTP connect. Which version of the IDF are you com...
by leenowell
Fri Feb 07, 2020 7:37 am
Forum: ESP-IDF
Topic: ESP32 IDF smtp (Simple Mail Transfer Protocol) support
Replies: 22
Views: 23011

Re: ESP32 IDF smtp (Simple Mail Transfer Protocol) support

@Vikram I have now tried to include your example code into my overall project (it is cpp if that matters) and am having trouble with the attachment code. I get a stream of the following error from within the while loop whilst it is reading the attachment and sending it to the SMTP server E (6131) sm...
by leenowell
Thu Feb 06, 2020 8:44 pm
Forum: ESP-IDF
Topic: ESP32 IDF smtp (Simple Mail Transfer Protocol) support
Replies: 22
Views: 23011

Re: ESP32 IDF smtp (Simple Mail Transfer Protocol) support

@Vikram Hi, I have finally had a chance to look at the code and have managed to fixed the attachment 0 bytes issue. I ended up changing the attachment header to be the following len = snprintf((char *) buf, BUF_SIZE, "Content-Type: image/png; name=\"esp_logo.png\"\r\n" "Content-Disposition: attachme...
by leenowell
Wed Feb 05, 2020 6:26 pm
Forum: ESP-IDF
Topic: ESP32 IDF smtp (Simple Mail Transfer Protocol) support
Replies: 22
Views: 23011

Re: ESP32 IDF smtp (Simple Mail Transfer Protocol) support

@Vikram Thanks for your reply. I have attached a zip file with the original esp_logo file (should be exactly the one in the zip you sent) and the zero bytes file that I received via email (had to change the name so the 2 didn't conflict). Looking forward to the next version to test :) Will look into...
by leenowell
Tue Feb 04, 2020 10:11 pm
Forum: ESP-IDF
Topic: ESP32 IDF smtp (Simple Mail Transfer Protocol) support
Replies: 22
Views: 23011

Re: ESP32 IDF smtp (Simple Mail Transfer Protocol) support

@Vikram I have tested the revised code and the byte count now seems to work fine. Unfortunately, the attachment still comes through via email as 0 bytes. A couple of comments/ questions on your responses below :) 1. How do you specify which file to upload and how does it get to the ESP to then attac...
by leenowell
Mon Feb 03, 2020 9:38 pm
Forum: ESP-IDF
Topic: ESP32 IDF smtp (Simple Mail Transfer Protocol) support
Replies: 22
Views: 23011

Re: ESP32 IDF smtp (Simple Mail Transfer Protocol) support

@Vikram I have done some further testing and found a couple of bugs (?). 1. The filename in the code where you upload the attachment has the wrong filename. It references test_image instead of sample_image. 2. Having correct this, it seems to upload the image but the received email has the attachmen...
by leenowell
Mon Feb 03, 2020 8:10 pm
Forum: ESP-IDF
Topic: ESP32 IDF smtp (Simple Mail Transfer Protocol) support
Replies: 22
Views: 23011

Re: ESP32 IDF smtp (Simple Mail Transfer Protocol) support

@Vikram Found the issue...I used the SSL port number (465) rather than the TLS port number (587). Looks like the error message was not ideal :). In trouble shooting it, I did have another suggestion. Since the error numbers are < 0 , printing the hex value is not ideal as it doesn't match the number...
by leenowell
Mon Feb 03, 2020 7:33 pm
Forum: ESP-IDF
Topic: ESP32 IDF smtp (Simple Mail Transfer Protocol) support
Replies: 22
Views: 23011

Re: ESP32 IDF smtp (Simple Mail Transfer Protocol) support

@Vikram Have given it a try against gmail servers. It connects to the smtp server ok but the next write_and_get_response (I believe) seems to fail returning -1. The log is (have removed the personal details with XXXX :) ).... load:0x3fff0018,len:4 load:0x3fff001c,len:7212 load:0x40078000,len:14176 l...
by leenowell
Mon Feb 03, 2020 9:34 am
Forum: ESP-IDF
Topic: ESP32 IDF smtp (Simple Mail Transfer Protocol) support
Replies: 22
Views: 23011

Re: ESP32 IDF smtp (Simple Mail Transfer Protocol) support

@Vikram Thanks very much for this. I have been searching around a lot for an IDF based example and it is difficult to find (most are Arduino based). I have found one and managed to get it working but now struggling with a very odd issue (just posted it on the forum). How complete / working is the ex...
by leenowell
Mon Feb 03, 2020 8:27 am
Forum: ESP-IDF
Topic: Calling from function causes odd behaviour
Replies: 0
Views: 1653

Calling from function causes odd behaviour

Hi All I have written a C++ class which sends an email. One of the member functions has some repeating calls so I decided to create a helper function (also part of the class) to clean up the code. This didn't work and I have boiled the issue down to the following weird behaviour. To make it simpler ...