HighTechTalks DotNet Forums  

Sending mail using Timer control in Global.asax

Dotnet Framework microsoft.public.dotnet.framework


Discuss Sending mail using Timer control in Global.asax in the Dotnet Framework forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Manoj
 
Posts: n/a

Default Sending mail using Timer control in Global.asax - 12-24-2007 , 05:31 AM






Hi Everyone,

System.timers.timer control is triggering every minute and it is
updating the application variable. But i am not able to send a mail when it
triggers.

please see the code below (Global.asax):

Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
Dim aTimer As New System.Timers.Timer
AddHandler aTimer.Elapsed, AddressOf OnTimedEvent
aTimer.Interval = 360000
aTimer.Enabled = True
GC.KeepAlive(aTimer)
Application.Lock()
Application("TimeStamp") = DateTime.Now.ToString()
Application.UnLock()
End Sub

Private Sub OnTimedEvent(ByVal source As Object, ByVal e As
Timers.ElapsedEventArgs)
Dim tm As New Tmail
Application.Lock()
Application("TimeStamp") = DateTime.Now.ToString()
tm.sendmail()
Application.UnLock()
End Sub


Please help me in this regard.
Thanks,
Manoj.

Reply With Quote
  #2  
Old   
vekateswar adusumilli
 
Posts: n/a

Default Re: Sending mail using Timer control in Global.asax - 12-27-2007 , 05:21 PM







I am also facing the same issue, did you get any solution for it.

*** Sent via Developersdex http://www.developersdex.com ***

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.