Reputation: 18963
i have developed one windows (desktop) based application which sends pdf as an attachments. the size of pds could range from 40 KB to 10-15 MB. But when i send an pdf more than 2.5 MB the file is never reaching the destination.
I try sending the file at our intranet as well popular internet (such as gmail, yahoo) email address but no luck!
Also i cross checked in SMTP Server. No such limitations has been imposed therein.
My code is in Asp.net 2.0 and C#.
let me know if more details required.
thanks a ton!
Upvotes: 3
Views: 1942
Reputation: 867
for security reasons ASP.net has a pre defined max size which is 4mb. to allow uploads you need to modify your web config. Adding the httpRuntime setting which is to be added to the section of your web config.
Below is an example of this which sets the upload size to be 8MB.
<system.web>
<httpRuntime maxRequestLength="8192"/>
</system.web>
see http://msdn.microsoft.com/en-us/library/e1f13641.aspx for more details.
Upvotes: 0
Reputation: 5921
Try with below code
SmtpClient.Timeout value.
or check out this link
http://forums.asp.net/t/1402417.aspx/1
Upvotes: 1