www.webdeveloper.com
Results 1 to 5 of 5

Thread: Automatic Email Reminder

  1. #1
    Join Date
    Dec 2002
    Posts
    177

    Automatic Email Reminder

    I have this website in ASP/Database driven website. In the database, I have a table with Members and Expiration Dates of their registrations.

    I want the website to be able to send an email reminder automatically when that expiration date is reached.

    I think I need some kind of Server Side component for this...if so, which one should I be looking at and is this doable?

  2. #2
    Join Date
    Jan 2008
    Location
    Florida
    Posts
    1,227
    On your new web server you can setup a daily batch script scheduled to run and query your database of subscribers. Based on date of expiration (or whatever) you can email members.

    I do this with several things including birthday emails daily.

  3. #3
    Join Date
    Nov 2002
    Location
    Norwood, MA
    Posts
    187
    Care to offer more detail? I'm also interested in implementing this on a Windows 2003 server where I'm running a website off IIS.

    Thanks!

    Me

  4. #4
    Join Date
    Jan 2008
    Location
    Florida
    Posts
    1,227
    It's extremely simple. Simply create a vbs file:

    dailyreminder.vbs
    Code:
    myconnectionstring
    mysqlquery (select from members where whatever)
    do until....
    mycdo script
    next
    Go to your window scheduler and schedule that file to run daily, weekly, etc.

  5. #5
    Join Date
    Nov 2002
    Location
    Norwood, MA
    Posts
    187
    Hoping people are still reading this thread... I tried the below "simpleton" code and it seems to be doing nothing. When I pop this into an ASP page and load it with a browser, it works fine, but not as a .vbs file just opened from a satelllite computer. Do I need to have it be opened on the server itself?

    Code:
    On Error resume Next
    Dim TBdy
    Dim MyCDO
    CR = Chr(13)
    Set MyCDO = Server.CreateObject("CDO.Message")
    If IsObject (MyCDO) Then
    	MyCDO.From = "something@other.com"
    	MyCDO.To = "something@other.com"
    	MyCDO.Cc = ""
    	MyCDO.Bcc = "something@other.com"
    	MyCDO.MailFormat = 0
    	MyCDO.BodyFormat = 0
    	MyCDO.Importance = 2
    	MyCDO.Subject = "Test of VBS file email"
    	TBdy = "<html>"
    	TBdy = TBdy & CR & "<head></head>"
    	TBdy = TBdy & CR & "<body>"
    	TBdy = TBdy & CR & "<p>"
    	TBdy = TBdy & CR & "Test email sent on " & Now()
    	TBdy = TBdy & CR & "</p>"
    	TBdy = TBdy & CR & "</body>"
    	TBdy = TBdy & CR & "</html>"
    
    	MyCDO.HTMLBody = TBdy
    	MyCDO.Send
    	Set MyCDO = nothing
    	Set TBdy = nothing
    Else
    	Response.Write("Email was not sent")
    End If

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles