Solved

Timeout directive in ASp.NET

Posted on 2008-06-19
1
667 Views
Last Modified: 2013-11-07
Hi
i have a website developed by ASP.NET 2.0  , I have one page called sendbulkemail.aspx , simply i send email to a  about 3000 custemr that exists in a table in our databse , any way , The problem is i got error meassege after may be 2 minute as follwoing
---------
The operation has timed out.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.Mail.SmtpException: The operation has timed out.

Source Error:


Line 43:         Dim smtp As New SmtpClient
Line 44:         '(4) Send the MailMessage (will use the Web.config settings)
Line 45:         smtp.Send(Mail)
Line 46:         '*************************
Line 47:         '(1) Create the MailMessage instance
--
I think this because the operation take long time so the error comes up
i heared about thers a directive called timeout  , but i is this will solve my problem ? if yes how to use this directive
thanks
0
Comment
Question by:ali_alannah
1 Comment
 
LVL 25

Accepted Solution

by:
apeter earned 500 total points
ID: 21821884
Set SmtpClient.Timeout Property. Default is 100 seconds. Set that property to "Int32.MaxValue".

smtp.Timeout = Int32.MaxValue.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Where is this file? 3 32
Need syntax help building hyperlink 2 39
How to filter by key press ? 6 54
Securing WEBAPI on Azure 2 19
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question