xorpower
xorpower

Reputation: 18963

Sending attachments of greater size asp.net

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

Answers (2)

Somedeveloper
Somedeveloper

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

sikender
sikender

Reputation: 5921

Try with below code

SmtpClient.Timeout value.

the default value is 100 seconds = 100000.

or check out this link

http://forums.asp.net/t/1402417.aspx/1

Upvotes: 1

Related Questions