Exceeded storage allocation. The server response was: 4.3.1 Message size exceeds fixed maximum message size

Ramesh.kbvr picture Ramesh.kbvr · Apr 11, 2011 · Viewed 26.4k times · Source

I am using SMTPclient to send mail with attachment. When the attachment is more than 2mb, I am getting the below error: ** "Exceeded storage allocation. The server response was: 4.3.1 Message size exceeds fixed maximum message size". **

1) Can i send email ** using smtpclient with attachment size >2mb. ** If yes, What is the limit of attachment.

2) How can i fix the above error?

Please give me an idea,if you have the solution.

Answer

odrm picture odrm · Apr 11, 2011

Modern SMTP mail servers have a configuration variable to set the maximum allowed message size. This defines the largest amount of data the mail server will accept in a single message. If you're trying to send a larger message, the server will reject it. You have quite a few options, however:

  1. Compress the attachment to reduce its size (e.g. using zip)
  2. Change the maximum message size limit on the server, but this requires admin access to the server
  3. Break your message down into smaller chunks, where each chunk is smaller than the server limit.
  4. Use a different mechanism/protocol to transfer the attachment.