SmtpClient.Send attachment maximum size

Ramesh.kbvr picture Ramesh.kbvr · Mar 10, 2011 · Viewed 19.6k times · Source

I am trying to send attachment mails in asp.net pages using SmtpClient.Send() method. It is working fine with 2mb files. When i tried with 7mb attachment file, it is saying:

Failure sending mail.

What is the max size for sending mail using SmtpClient.Send(message) method. Why the above error coming.....?

Answer

Albin Sunnanbo picture Albin Sunnanbo · Mar 10, 2011

The documentation for SmtpClient or MailMessage does not say anything about size limits. Most likely this is enforced by your SMTP server. You should check your SMTP server configuration for size limits.