I want to write a script that sends an e-mail with attachments (different sizes, different recipients). I wish prior to sending e-mail, somehow detect if recipient's mail server can handle the size of it. Is there a way to do this?
You can try to telnet to the recipients email server on port 25 and issue the EHLO command. The server should respond with the EHLO commands that it supports and should list the size limit that it supports. This is not a guaranteee that the recipient mailbox will accept an email of the same size though.