473,397 Members | 2,116 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,397 software developers and data experts.

SQL Server and Automated Emails

Hi, folks. I'm fairly new to SQL Server, so forgive any stupidity
inherent in this question. I work at a university and a certain
faculty member would like to have her students create a simple auction
web site as an exercise. As part of the assignment, she wants the
auction site to be able to send an email to a bidder when they have
been outbid.

So she has asked me if this is possible, and how to do it. I've read a
bit about sending an automated email from SQL Server, but I can't find
anything about how to trigger the email based upon a field comparison
in the database. I also don't know how to incorporate a field value as
a variable into the body of the email.

Of course, I don't expect anyone to solve my entire problem in this
forum. I was just hoping that someone could point me in the right
direction. Can anyone give me any advice about where I should be
looking for such info? Can you recommend a web page, or some other
reference material? Is there a specific terminology I should be using
when I search? I just don't seem to be able to find what I need.

Please reply to se***@psu.edu -- I don't read newsgroups regularly.
Many thanks in advance!

--Sue

Jul 23 '05 #1
3 1572
Hi Sue,

You can certainly accomplish this in SQL Server, but I'm not sure if
you really should or not. Typically, the database should be left to do
database things. Since the users have to enter their bids into the
website, you may want to look into generating the email at that point,
using code in the middle tier of your application. This of course
depends on your programming language there - ASP.Net, ASP, Java, etc.

If you have your mind set on doing it in SQL Server, then you will want
to look into xp_sendmail or xp_smtp_sendmail. You can pass in the email
message, so inserting column values is just a matter of concatenating
your message together correctly before calling the mail sending
procedure.

Since you want to send this email out whenever a person is outbid, then
you *could* include the send mail code in the appropriate trigger(s)
where bids are tracked. However, it is strongly advised that you do not
use code that calls external applications from within triggers. There
are a lot of potential problems there. Another method would be to have
the trigger merely insert a record into a table that serves as the
email queue. You could then have a job that runs every so often (every
hour, every 5 minutes, whatever) that checks the queue for any
unprocessed emails and sends them out.

HTH,
-Tom.

Jul 23 '05 #2
"Thomas R. Hummel" <to********@hotmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...

<< Flippin new google! >>
So...
Coupla million emails in some teachers in-box?
If you have your mind set on doing it in SQL Server, then you will want
to look into xp_sendmail or xp_smtp_sendmail. You can pass in the email
message, so inserting column values is just a matter of concatenating
your message together correctly before calling the mail sending
procedure.

Since you want to send this email out whenever a person is outbid, then
you *could* include the send mail code in the appropriate trigger(s)
where bids are tracked. However, it is strongly advised that you do not
use code that calls external applications from within triggers. There
are a lot of potential problems there. Another method would be to have
the trigger merely insert a record into a table that serves as the
email queue. You could then have a job that runs every so often (every
hour, every 5 minutes, whatever) that checks the queue for any
unprocessed emails and sends them out.

HTH,
-Tom.


Definitely go for the write to table and job processes table thing.
Could perhaps become rather more complex if you want an e-bay style
automatically upping of bids.
Jul 23 '05 #3
>Since the users have to enter their bids
into the website, you may want to look
into generating the email at that point,
using code in the middle tier of your application.


I thought of this after I posted my message, and your advice confirms
for me that this would be the best approach. I feel dumb for not having
thought of it earlier! Thanks so much, everyone, for the input. I
greatly appreciate it.

-Sue

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #4

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

Similar topics

0
by: Alan Kennedy | last post by:
Hi All, I'm writing an application that sends out emails, for workflow-item tracking purposes. I am using a VERP-style addressing mechanism, whereby I send each message from an uniquely...
3
by: Bengt Richter | last post by:
I find that threads sometimes mention PEPs that I wasn't aware of, or that an interesting one has been updated without my noticing. I should perhaps check the PEP site more regularly, but ISTM it...
3
by: yoda | last post by:
Hi Guys, I've been used to deploying code to the production server by checking out of subversion and manually sorting out any kinks. (yes, I know, it sounds primitive) I realize I'm losing so...
13
by: Benny | last post by:
Dear All, I need to send a set of Emails from my application (reminders) each month 1st. Is there anyway in ASP scripts to trigger an event to run automatically? I have no dedicated server, so...
2
by: kimberly.shaffer | last post by:
Okay, I can automate sending of multiple emails with records using Groupwise and Access DB. But now what I need to do is send multiple fields associated with one field out automatically and can't...
7
by: tshad | last post by:
I am trying to figure out the best way to send automated emails? I have emails that I want to send out to certain clients that need them either daily or weekly. How would I do in asp.net? ...
1
by: lekshmi200 | last post by:
I want to send automated emails. I want to send emails to some persons in the table at the end of the day like 10.00 pm every day. How do I do that? I am using python and mysql.pliseeeeeee give me a...
0
by: tonydevlin | last post by:
I currently have the python code obj=sti.object creator = obj.Creator() history = sti.getHistory() wf_tool = context.portal_workflow mMsg = """ Content has been submitted for your review....
2
by: techsri | last post by:
Hi, We are going to launch a website which offers free e-learning courses to the users. we are facing some problems to build my site. The problem is about, We want add push email feature to our...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.