Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Friend,
I have some problem when implementing code.I have an idea about that "how to send email" but no idea about "how to send email in particular days or how to sheduled emails".
For example :-if i am registered any website then if i am not used this website then automatically send notification emails particular 15 days later.I cant get an idea how to do so would you like to suggest me anything idea or information.

Thanks in advanced !!
Posted
Comments
Thanks7872 1-Jul-13 8:37am    
Which is the database?
Member 8089110 1-Jul-13 8:55am    
Microsoft Sql Server 2008
ZurdoDev 1-Jul-13 8:42am    
The best way, in my opinion, is a windows service.
Member 8089110 1-Jul-13 8:56am    
i want to program by using asp.net,c#,linq,sql server 2008

Following 3 steps will get your job done:
1. Create a table in the database (say Email) and insert all the information related the email like subject, body, From, To etc. along with the date on which the email is to be sent (EmailSendDate).
2. Write a SP which will read above (Email) table and send email if current date is equal to the EmailSendDate.
3. Create a Job in the SQL server which will run every day (or the way you want), and call above SP in that job.

Hope this will help you.

~Amol
 
Share this answer
 
Comments
Thanks7872 1-Jul-13 12:11pm    
Excellent.upvoted..!
Amol_27101982, India 2-Jul-13 5:17am    
Thanks dude...:)
Thanks7872 2-Jul-13 5:17am    
You are welcome.
The best way i think would be to use SQL Server Job. You can use that on predefined time interval as you want. For reference you can refer to below links.

A scheduler GUI for SQL Server Agent[^]

Manage SQL Server Agent Jobs using C#[^]

Schedule a Job[^]

How to: Schedule a Job (SQL Server Management Studio)[^]

[Important]:

sp_send_dbmail[^]

Regards.. :laugh:
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900