Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any way to query the exchange server to determine the maximum attachment file size? I'd be doing this in ASP.NET/C#. I'd like to be able to validate the file they want to attach is not over the limit before the user attempts to send the file to the server as opposed to having the server send back an exception when it attempts to attach the file and it discovers the file is too large.

I've also posted this question about this on as well - I figured a sysadmin for Exchange may have an answer as well as a developer. Hopefully I do not incur the wrath of the stackexchange gods.

share|improve this question

There are actually quite a few places you can set the attachment size limit in Exchange, server, mailbox, send connector etc. You can obtain these limits using powershell. Take a look at this article to see all these options and the powershell to find them out.

You can host a powershell runtime inside a .net application. This would allow you to run Powershell commands and get back .net objects to work with.

share|improve this answer
I believe he is asking how to determine the limits of a remote mail server, but I could be incorrect. – Zoredache Jan 25 '11 at 0:35
@zoredach good point, if it is a remote server you are talking to this will not work , – Sam Jan 25 '11 at 7:30
Zoredach is correct - I am looking to find the limit on the attachment size that has been set on the server. It is for an application that will be running in the same domain as the Exchange server if that makes a difference. – Jeff Jan 25 '11 at 16:51
@Jeff ok, so if you are on the same domain and your admin will let you, then you should either be able to install the Exchange management console on your server (so being able to run Exchange Powershell commands on that server) or run remote powershell commands on a machine with the management tools installed. – Sam Jan 25 '11 at 16:59


open 25


share|improve this answer
That won't necessarily reveal anything about limits. – John Gardeniers Jan 25 '11 at 4:14
Sure it will. It will list the ESMTP commands that the server supports and will show you what the global size limit is. – joeqwerty Jan 25 '11 at 13:14
This will give you the server limit, but any connector or mailbox limits won't be on there. – Sam Jan 25 '11 at 17:00
I've opened the telnet session and issued the ehlo command. Is there any specific verbiage I should be looking for that will indicate the global size limit? After typing "ehlo" I see: 250-SIZE along with a number of other values. Should I expect to see a number after the size? Also, is this the total message size limit - not just the attachment? – Jeff Jan 25 '11 at 17:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.