Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need help! VBSCript with SQL database connection, and send out email

Status
Not open for further replies.

kathykathy

IS-IT--Management
Mar 6, 2002
3
US
Hi,

I need help, please, this is urgent :( i was trying to figure this out for days and now my deadline is coming.
I have a search agent built in ASP but I needto write a VBScript to be scheduled on the SQL server box to run and and send email notifications out say every day at 12am.
This is more like the search agent at Monster.com.
I have 2 database table for resource_notifications which contains "Id" "person" "condition" and "date_submited".
The script is more like when there are new jobs coming and the system would do the match at the scheduled task and send out email notifications to the users.
anyone could help and any sample script?

Thanks a million!

K
 
Mmmmkay, going by the description you gave (you may need to get a little more detailed on the individual components), I'm assuming that you need a script to run every night at midnight that is going to pull email addresses out of a database and automatically send mail out to each address.

You mentioned that you have 2 databases, but only described one. I'm also assuming that the "person" column is the email address it's going to send to? If this is the case, view this page:


This is simply the source for an ASP script that you can view (it doens't actually run; no ASP on that server).
 
There are lots of properties for the ml. object that may come in handy also:

ml.AttachFile
ml.AttachURL
ml.Bcc
ml.BodyFormat
ml.Importance
ml.MailFormat
ml.Value
 
thanks-Disorder3r.

Yes, the funcationality of this VBS is to run on the server once a day to pull data from 2 database table: resource_notifiction which contains user information and search agents conditions. another table is "resource_request"that all all new job posting enters into this table, the VBScript needs to compare these 2 tables and see if there's any job matching users criteria.
Thanks,
 
It's going to come down to how the entry in resource_notification is going to be matched to something appropriate in resource_request. Assuming that "condition" is what the person is looking for, and it exists in both tables, you could do something like this:


In this sample, it's possible for people to get multiple mailings because the nested loop doesn't just stop once a match is found. It processes every request against every resource.
 
thanks for your helpful messages! i appreciate!

For the email notification part, can the system only search and compare new job postings with the new search agents created? like can we make a timestamp to match new jobs only happened to posted after the search agents created?

Thanks a million!

Kathy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top