473,387 Members | 1,575 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Auto mailer

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 = "su******@yahoo.com"
mail.To = "su******@yahoo.com"
mail.Subject = "Auto Message from Web Site"
mail.BodyFormat = MailFormat.Text
mail.Body = "Test"
SmtpMail.Send(mail)
End Sub
Nov 18 '05 #1
2 1632
ASP.NET pages aren't designed to do that kind of thing.
Instead I'd suggest creating a Windows Service.
Here's more information on Windows Services:
http://msdn.microsoft.com/library/de...owsService.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Sunil" <su******@yahoo.com> wrote in message
news:66**************************@posting.google.c om...
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 = "su******@yahoo.com"
mail.To = "su******@yahoo.com"
mail.Subject = "Auto Message from Web Site"
mail.BodyFormat = MailFormat.Text
mail.Body = "Test"
SmtpMail.Send(mail)
End Sub

Nov 18 '05 #2
Thanks for your help. i've managed to make the code work, and its working fine.
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message news:<uG**************@TK2MSFTNGP12.phx.gbl>...
ASP.NET pages aren't designed to do that kind of thing.
Instead I'd suggest creating a Windows Service.
Here's more information on Windows Services:
http://msdn.microsoft.com/library/de...owsService.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Sunil" <su******@yahoo.com> wrote in message
news:66**************************@posting.google.c om...
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 = "su******@yahoo.com"
mail.To = "su******@yahoo.com"
mail.Subject = "Auto Message from Web Site"
mail.BodyFormat = MailFormat.Text
mail.Body = "Test"
SmtpMail.Send(mail)
End Sub

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Raphael Gluck | last post by:
Hi all I am still finding my feet creating a website in ASP, and i'm trying to get to grips with users providing feeback to my site. my webhosts have the dundas mailer installed, and i am trying...
2
by: John Davis | last post by:
What is the **MOST** obvious reason why will this will fail (it's not syntax or anything specific to the object)? Function Mail(MailerProgram, Message, Subject, Format, FromEmail, ToEmail,...
8
by: Dave Smithz | last post by:
Hi, Thanks to this group I discovered the excellent PHP Mailer (http://phpmailer.sourceforge.net/) which I use to send emails. Part of my application emails out hundreds of club members unique...
10
by: Flopper | last post by:
Hey can anyone help me with a WORKING anonymous mailer php script. I've looked on the net but only find non working one's. Greetings Floppie
1
by: Beyza | last post by:
Hi, I have a problem. One of my customer used to use php mailer in her web page. But when i changed something in the system (php packages) , it was broken. If she use php-mailer in her system,...
4
by: =?Utf-8?B?TWlrZSBI?= | last post by:
I'm using a block of ASP to allow a user to send a form via e-mail. However, someone keeps sending me spam through this form and they're using a bogus return address. I'm testing for a successful...
6
by: Dave Kelly | last post by:
Sorry for the long post, it is easier to discard information than to have to wait for it to arrive. So here goes: This code worked perfectly when I was an Earthlink customer. Sprint decided...
2
by: HariKutty | last post by:
Hello Every one My Use Case: I want to display the list of matching email address from the word typed in by the User. Example If the User types "a" in textbox then it shoud display ...
9
by: neovantage | last post by:
hey geeks, I have a small mail script which will cause a PHP script to send a receipt upon clicking the submit button, by an HTML mail. This mail contains special characters, namely 'å', 'ä' and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.