Can someone tell me, how could I check the size limit of an email message. So, if all attachements together exceeded the limit, I could send them in more messages. And lets say that each attachement is smaller than limit size.
Im using python 2.7 (email, smtplib modules).
Any suggestions, samples, links.. would be appreciated.
Ok, I found that out :)
import smtplib
smtp = smtplib.SMTP('server.name')
smtp.ehlo()
max_limit_in_bytes = int( smtp.esmtp_features['size'] )
This returns size limit (in bytes) of entire email (with header, subject, message text...).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With