Auto mailer

  • Thread starter Thread starter Sunil
  • Start date Start date
S

Sunil

Hi,

i am trying to send an automated mail at a particular time of the day
from the web site. below is the code i tried. but the mail is not
sent.

Can anyone throw some light on the issue.

Thanks.


Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the application is started
mTimer.Interval = 10000
mTimer.Enabled = True
AddHandler mTimer.Elapsed, AddressOf mTimer_Elapsed
End Sub

Sub mTimer_Elapsed(ByVal sender As Object, ByVal e As
System.Timers.ElapsedEventArgs)
Dim mail As New MailMessage
mTimer.Enabled = False
mail.From = "(e-mail address removed)"
mail.To = "(e-mail address removed)"
mail.Subject = "Auto Message from Web Site"
mail.BodyFormat = MailFormat.Text
mail.Body = "Test"
SmtpMail.Send(mail)
End Sub
 
Back
Top