1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Send an email after x number of days

Discussion in 'C#' started by tomred, Jul 9, 2008.

  1. #1
    Hi,

    Im running a website where people register and post classified ads. Im already able to send out registration emails when a person registers using Persits.MailSender.

    Users can then add classified ads to the site. What I want to do is send an automatic email 7 days after the person creates the advert.

    Any ideas?

    Thanks for the help
    SEMrush
     
    tomred, Jul 9, 2008 IP
    SEMrush
  2. VishalVasani

    VishalVasani Peon

    Messages:
    560
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hello,

    You can do it with schedule task.
    You required to setup as script in server that run for you.
     
    VishalVasani, Jul 9, 2008 IP
  3. mfawn

    mfawn Active Member

    Messages:
    573
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    80
    #3
    You can sign up with an email auto repsonder site that allows you to schedule timelines for email to be published.

    http://www.getresponse.com/
     
    mfawn, Jul 10, 2008 IP
  4. itcn

    itcn Active Member

    Messages:
    795
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    68
    #4
    I would create a ASP page which looks through your database, and if it finds a record 7 days old, it sends an email to it.

    Next just setup an AT shedule job on the server which calls that ASP page every night. This way every night the script will run, and email any accounts which are 7 days old.
     
    itcn, Jul 11, 2008 IP
  5. tomred

    tomred Peon

    Messages:
    382
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks itcn,

    This is what im thinking, I can set up the ASP page ok, its the AT Schedule Job you mention, I've never done this before, is it handy enough to do?

    Im using a mySQL DB.
     
    tomred, Jul 15, 2008 IP
  6. itcn

    itcn Active Member

    Messages:
    795
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    68
    #6
    It's not hard, but depends on which version of Windows Server you're running. I forget where it was in Windows 2003, but I'm running Windows 2008 and all you have to do is click on Start > Administrative Tools > Task Scheduler. The just click Create Basic Task. For the action just input:
    "C:\Program Files\Internet Explorer\iexplore.exe" http://nameofsite/yourpage.asp

    This will open IE and run your ASP page. Just schedule it to run every night.
     
    itcn, Jul 15, 2008 IP
  7. Social.Network

    Social.Network Member

    Messages:
    519
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    35
    #7
    I use a mail list manager for a couple of sites; do you want the solution to send an unattended email? If so, there are several options. Are you using MS SQL Server on the backend, if so have you tried the SQL Mail function? The mail can be automated via scheduled tasks. Also, instead of shelling out to IE and navigating to an ASP page, the mail component can be wrapped and called from a batch service manager class (can be as simple as a run method on the wrapper class).
     
    Social.Network, Jul 15, 2008 IP
  8. jscowen

    jscowen Peon

    Messages:
    148
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Depending on your hosting type (shared, VPS, dedicated) and control panel sometimes you don't have access to scheduled tasks.

    When I've encountered this I've either:
    a) got a cheap UNIX hosting account with 'cron'/cPanel and called the asp page once a day, or
    b) on my home page I include code that checks to see whether my daily email code has run in the last 24 hours - if not I run the code.

    I prefer option A but as long as you pretty good traffic option B does do the trick.
     
    jscowen, Jul 15, 2008 IP
  9. tomred

    tomred Peon

    Messages:
    382
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #9
    I got this working, Via a windows scheduled task.

    I first of all wrote a simple VB script that looped through the database.

    The ST then runs this script daily.

    Thanks for the help
     
    tomred, Jul 18, 2008 IP