Hi, could you tell me how large the email is? How many attachment were added and the attachment size?
Originally Posted by: ivan
Sorry, i dont have this information yet.
I tried to reproduce this problem at my computer and attached a large file with 154mb.
The app started sending the email and i checked with the tool TCPview the transfer to the email server. After some time i got the error message "Error with sending data;socket error - DATA stream".
The memory usage of my app jumped from 9.072K to 663.324K using a attachment with 154mb after the data sending is started. Using a attachment with 404MB the memory usage jumped to 1.715.836K! The memory usage dropped down to 13.000K after the error message occurred. Why does a 404MB file need 1.7GB RAM?
It looks like that you first read the complete content of the attachment into the memory and after that you start sending the data. That is ok for small emails but with large attachments it would be a much smarter programming style to read the attachment on thy fly chunk by chunk when sending the data to the email server, or?
Lets say you have a 32bit app with a maximum possible RAM usage of 2GB and your app already used 1.8GB of the RAM and now you want to send an email with a large attachment...out of memory ;-)
Error message from your DLL when sending an email with an 754mb attachment:

You should handle this "out of memory" error inside your DLL and return a normal error message because this crashes my app too and i cant catch the error message 😞
Edited by user
8 years ago
|
Reason: added a screenshot