Sending email automatically?
-
How can I send email every day automatically in ASP.Net website? Your idea will be appreciated. Thanks a bunch... Learning .NET
Hi there. You may want to describe in a little more detail what you want to accomplish. If you're looking to have a nightly (daily?) email sent, you wouldn't need to do it from within ASP.NET. You could just use the Windows Scheduler (or
at
command from a command line) to schedule a recurring task, having it send an email. You can look here[^] for a command-line emailer written in .NET if it is useful. I use it for exactly what you have described so far - sending daily emails following the execution of batch jobs. -
Hi there. You may want to describe in a little more detail what you want to accomplish. If you're looking to have a nightly (daily?) email sent, you wouldn't need to do it from within ASP.NET. You could just use the Windows Scheduler (or
at
command from a command line) to schedule a recurring task, having it send an email. You can look here[^] for a command-line emailer written in .NET if it is useful. I use it for exactly what you have described so far - sending daily emails following the execution of batch jobs.Thanks for your reply. Yeah, here i describe it. I build an school library application for my final project. What i want to accomplish is sending an email to some email addresses that haven't returned their book according to due date.Thus it need to check the overdue loan everyday, then send them an email automatically. Problem is the school doesn't allow me to touch the server things, then i can't schedule using the windows scheduler. is it possible i use the windows scheduler to accomplish the email thing according to my case? If could, how? If possible, i want to search for a .Net service that can schedule a task, in this case sending an automate email.
-
Thanks for your reply. Yeah, here i describe it. I build an school library application for my final project. What i want to accomplish is sending an email to some email addresses that haven't returned their book according to due date.Thus it need to check the overdue loan everyday, then send them an email automatically. Problem is the school doesn't allow me to touch the server things, then i can't schedule using the windows scheduler. is it possible i use the windows scheduler to accomplish the email thing according to my case? If could, how? If possible, i want to search for a .Net service that can schedule a task, in this case sending an automate email.
Hi there. I can see what you mean - these things can be tough when you don't have access to the server. Unfortunately, you really are looking for a service of some kind for scheduling which implies the server. Maybe you could set up a workstation and use the Windows Scheduler on it to execute a task (.NET command-line application?) that would query for the appropriate email addresses (I'm assuming they are in a database? do you have access to query it?) and send emails. Assuming you have access to query for the email addresses, and access to send mails through an SMTP server, this wouldn't be too difficult an app to write. I've sent you a link to an article which shows an example of using the
System.Web.Mail
objects for sending mail. There are lots of examples around that show how to connect to and query a database... you could get your email addresses in aDataSet
object, then loop through the rows, constructing and sending aMailMessage
for each... package it up as a console application running on a workstation - again, as long as the privileges exist for that workstation to connect to the server, query, and send SMTP mail, you could make it work using the workstation's Scheduler service.