Solved

Timeout directive in ASp.NET

Posted on 2008-06-19
1
663 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

867 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now