Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Send mail automatically from ASP.NEt [modified]

Send mail automatically from ASP.NEt [modified]

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdatabasequestion
7 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rohde
    wrote on last edited by
    #1

    I need to send mails automatically once a week from an ASP.NET app based on some information stored in the database. I guess the only way to do that is to have a Windows Service right?


    "When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
    -Atlas Shrugged, Ayn Rand

    N J P D 4 Replies Last reply
    0
    • R Rohde

      I need to send mails automatically once a week from an ASP.NET app based on some information stored in the database. I guess the only way to do that is to have a Windows Service right?


      "When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
      -Atlas Shrugged, Ayn Rand

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      Two options are 1 - Windows services 2 - A windows application runs on background and giving request to a web service which sends mail


      My Website | Ask smart questions

      1 Reply Last reply
      0
      • R Rohde

        I need to send mails automatically once a week from an ASP.NET app based on some information stored in the database. I guess the only way to do that is to have a Windows Service right?


        "When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
        -Atlas Shrugged, Ayn Rand

        J Offline
        J Offline
        John ph
        wrote on last edited by
        #3

        Rohde wrote:

        I guess the only way to do that is to have a Windows Service right?

        I guess there is one more way to do this. You can schedule a job on the database-side using SQL Server Agent which will wake up every morning and do the task.

        Rohde wrote:

        I've tried to persuade the powers in be that the easiest way is for somebody to click a button every Monday morning to start the procedure

        Triggering a procedure from the application side on the button click event to perform a scheduled task is not a good practice. What if the person forget's to do his task... Yes, you can write a windows service to perform this task...

        Regards
         - J O N -


        R 1 Reply Last reply
        0
        • R Rohde

          I need to send mails automatically once a week from an ASP.NET app based on some information stored in the database. I guess the only way to do that is to have a Windows Service right?


          "When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
          -Atlas Shrugged, Ayn Rand

          P Offline
          P Offline
          P A N K A J
          wrote on last edited by
          #4

          You can also use the database directly to send the emails. for this create a strored procedure and scheduled a job in the database then will run automatically after the specified time.

          Pankaj Gupta (Take it easy)

          R 1 Reply Last reply
          0
          • P P A N K A J

            You can also use the database directly to send the emails. for this create a strored procedure and scheduled a job in the database then will run automatically after the specified time.

            Pankaj Gupta (Take it easy)

            R Offline
            R Offline
            Rohde
            wrote on last edited by
            #5

            Yes I know, but we're using MySQL v5.0 and events are in v5.1 which at the moment is a release candidate.


            "When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
            -Atlas Shrugged, Ayn Rand

            1 Reply Last reply
            0
            • J John ph

              Rohde wrote:

              I guess the only way to do that is to have a Windows Service right?

              I guess there is one more way to do this. You can schedule a job on the database-side using SQL Server Agent which will wake up every morning and do the task.

              Rohde wrote:

              I've tried to persuade the powers in be that the easiest way is for somebody to click a button every Monday morning to start the procedure

              Triggering a procedure from the application side on the button click event to perform a scheduled task is not a good practice. What if the person forget's to do his task... Yes, you can write a windows service to perform this task...

              Regards
               - J O N -


              R Offline
              R Offline
              Rohde
              wrote on last edited by
              #6

              John Prabhu wrote:

              I guess there is one more way to do this. You can schedule a job on the database-side using SQL Server Agent which will wake up every morning and do the task.

              Yes I know, but our current RDBMS doesn't have that functionality, MySQL v5.0, but events will debut in MySQL 5.1 so perhaps we will look at if and when we upgrade.


              "When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
              -Atlas Shrugged, Ayn Rand

              1 Reply Last reply
              0
              • R Rohde

                I need to send mails automatically once a week from an ASP.NET app based on some information stored in the database. I guess the only way to do that is to have a Windows Service right?


                "When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
                -Atlas Shrugged, Ayn Rand

                D Offline
                D Offline
                DigiOz Multimedia
                wrote on last edited by
                #7

                Rohde wrote:

                I need to send mails automatically once a week from an ASP.NET app based on some information stored in the database. I guess the only way to do that is to have a Windows Service right?

                Basically what J4amieC said, which is: 1- Create a small windows app that simply calls the ASP.NET page. 2- Schedule a windows task to call that EXE once a week. 3- Send the email through the ASP.NET page in question. Of course the whole thing would have been easier if you could run cron jobs on windows. :laugh:

                Pete Soheil DigiOz Multimedia http://www.digioz.com

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups