Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
kennrosie
Starting Member
2 Posts |
Posted - 2005-11-30 : 13:45:26
|
| I am using visual studio.net. I want the system to send an email 30 days prior to a due date. Example: Employee Performance due date: 12 Dec 2005 I would like the system to generate an email to the supervisor on 12 Nov. 2005 I have not found any material on how to perform this function. |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-11-30 : 14:01:33
|
| Hi kennrosie, Welcome to SQL Team!Schedule a task daily, or hourly, and check for any Emails that are "overdue" and send them. Then mark the database that that Email has been sent (so that it doesn't get sent again).You might create a database table of "Emails to be sent" which has a date/time when the Email should be sent, and a "type" that indicates which email template to use, and maybe the TO Email address (or some ID of the record to be used to get the TO email address from)Kristen |
 |
|
|
druer
Constraint Violating Yak Guru
314 Posts |
Posted - 2005-11-30 : 16:38:13
|
| You can do it in SQL Server as Kristen suggested (lookup xp_sendmail in books on line for help)You'll also need to be sure that your DBA has configured your system to use email which is easy to do, but does require a couple of steps. Most likely it would have been done so that they could receive emails on alerts from the server, but who knows. |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-12-01 : 00:32:01
|
| "but who knows"FWIW we don't do that on our SQL boxes 'coz I'm paranoid and don't want Outlook on them ... and I haven't been able to find another way to get the necessary MAPI bits onto the SQL boxes.Kristen |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2005-12-01 : 01:15:26
|
| We've been running Outlook on all of our database servers for a few years now. A few of these db servers are consider 5 9s. We've never had any problems with the client. The only problems that we've had has been with SQL Mail specifically. Since upgrading to the new version of Outlook (I think it's 2002 or XP version), all of our SQL Mail problems went away. But even the 2000 client didn't cause any issues on the server. It's just that SQL Mail wouldn't work sometimes with that client.Tara Kizeraka tduggan |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-12-01 : 01:33:48
|
| Perhaps I should take a Chill Pill then ... thanks for that Tara, I'll give it another go 'coz it would obviously be handy to have EMail running on the SQL boxes (but I still think it should be possible to install WIHTOUT having to put Outlook on ...)Kristen |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2005-12-01 : 02:58:44
|
| you can create the program (smtp) in .net (which is a lot easier) that queries through the table that Kristen mentioned and schedule it to run via windows scheduler (not sql server job)HTH--------------------keeping it simple... |
 |
|
|
|
|
|