Birthday reminder email

Discussion in 'Databases' started by sonstraal, Nov 6, 2007.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi all !


    I have an MSAccess database with 2 tables: Buyers and Sellers





    I have the following entries for each user in each table:


    mBirthday (day of the month, i.e. 1, 2, 3, etc)


    mBirthmonth (month of the year, i.e. 1, 2, 3, etc)


    I needan application which I can schedule to run every dayto check both tables daily to see who has a birthday onthe followingday, and then the application must send me an email with those people's details so that I can wish them happy birthday on their birthday.


    Do you have any ideas? I really hope you can help me.


    Much appreciated !!
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    try use the scheduled task tool in the control panel to schedule this.


    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. Hi Bruce,


    Yes I will use the scheduled task, but i need to write an application that will do what i need done, then i can schedule that application to run daily.


    Any ideas on how i cn write the application?
     
  4. Bruce

    Bruce DiscountASP.NET Staff

    It depends on how much knowledge you have with ASP or ASP.NET. Are you familiar w/ either technology?



    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  5. I don't have too much experience with asp, but i thought maybe i could make a asp page with the following?


    but it doesn't seem to work? :


    <%
    strsql = "Select * from jcRemax WHERE mBirthDate = Date()"
    set rsm = server.createobject("adodb.recordset")
    rsm.Open strsql,conn2,3,3

    do while not rsm.eof

    SET objMessage = CreateObject("CDO.Message")
    set objConfig = createobject("cdo.configuration")
    ' Setting the SMTP Server
    Set Flds = objConfig.Fields
    Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
    Flds.update
    Set objMessage.Configuration = objConfig
    objMessage.From = "[email protected]"
    objMessage.To = "[email protected]"
    objMessage.Subject = "Birthday: " &amp; rsm("mFirstName") &amp; " " &amp; rsm("mLastName")
    objMessage.HTMLBody = "Name: " &amp; rsm("mFirstName") &amp; " " &amp; rsm("mLastName") &amp; ""
    "Birthday: " &amp; rsm("mBirthday") &amp; " " &amp; rsm("mBirthmonth") &amp; ""
    "Email: " &amp; rsm("mEmail") &amp; ""
    "Cellphone: " &amp; rsm("mCellphone") &amp; ""
    "Address: " &amp; rsm("mAddress") &amp; rsm("mSuburb") &amp; ""
    objMessage.fields.update
    objMessage.Send
    SET objMessage = Nothing
    set objConfig = nothing

    rsm.movenext
    loop



    rsm.Close


    end if
    %>
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page