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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. how to send mail with target date +.net with c#

how to send mail with target date +.net with c#

Scheduled Pinned Locked Moved ASP.NET
csharpcomtestingbeta-testingtutorial
11 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.
  • S sugunavathysubramanian

    hai, i am using MailMessage mailMessage = new MailMessage(); mailMessage.From = "Magesh@Test.com"; mailMessage.To ="sugunaavthy.s@afxisi.co.in"; mailMessage.Subject = "Hi"; mailMessage.Body = "Hi This One Is For Testing"; SmtpMail.Send(mailMessage); it work fine.but i want to know how to send mail on (ex:25/7/2008) any date.if know the answer replay to me.. thank you.

    C Offline
    C Offline
    Christian Graus
    wrote on last edited by
    #2

    This has nothing to do with ASP.NET. And, you can't, at least not using anything built in. You need to write code, such as a service, that watches the time and sends it when you want it sent.

    Christian Graus No longer a Microsoft MVP, but still happy to answer your questions.

    1 Reply Last reply
    0
    • S sugunavathysubramanian

      hai, i am using MailMessage mailMessage = new MailMessage(); mailMessage.From = "Magesh@Test.com"; mailMessage.To ="sugunaavthy.s@afxisi.co.in"; mailMessage.Subject = "Hi"; mailMessage.Body = "Hi This One Is For Testing"; SmtpMail.Send(mailMessage); it work fine.but i want to know how to send mail on (ex:25/7/2008) any date.if know the answer replay to me.. thank you.

      M Offline
      M Offline
      Member 3879881
      wrote on last edited by
      #3

      Hi suguna..., This is Magesh, See ur From address the same one :)..., Ya u can send mail at particular date.., For that u have to fire the schedule task..., In that u have to give the mail send event have to fire on which date..., Then it will send the mail to particular id Keep smile always

      Thanks & Regards, NeW OnE, please don't forget to vote on the post

      S 1 Reply Last reply
      0
      • M Member 3879881

        Hi suguna..., This is Magesh, See ur From address the same one :)..., Ya u can send mail at particular date.., For that u have to fire the schedule task..., In that u have to give the mail send event have to fire on which date..., Then it will send the mail to particular id Keep smile always

        Thanks & Regards, NeW OnE, please don't forget to vote on the post

        S Offline
        S Offline
        sugunavathysubramanian
        wrote on last edited by
        #4

        hai mahesh, i am using sql server, string date = string.Format("{0:MM/dd/yyyy}", DateTime.Now); string senddate="27/7/2008"; if (senddate==date) { MailMessage mailMessage = new MailMessage(); mailMessage.From = ""; mailMessage.To = ""; mailMessage.Subject = "hai"; mailMessage.Body ="hello"; mailMessage.BodyFormat = MailFormat.Html; mailMessage.Priority = MailPriority.High; SmtpMail.Send(mailMessage); } i wrote code in page_load event.i host the project in server it will work or not. replay...thanks .

        C M 2 Replies Last reply
        0
        • S sugunavathysubramanian

          hai mahesh, i am using sql server, string date = string.Format("{0:MM/dd/yyyy}", DateTime.Now); string senddate="27/7/2008"; if (senddate==date) { MailMessage mailMessage = new MailMessage(); mailMessage.From = ""; mailMessage.To = ""; mailMessage.Subject = "hai"; mailMessage.Body ="hello"; mailMessage.BodyFormat = MailFormat.Html; mailMessage.Priority = MailPriority.High; SmtpMail.Send(mailMessage); } i wrote code in page_load event.i host the project in server it will work or not. replay...thanks .

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #5

          I love it when I tell people something and they ignore me. If you put the code in your page load, then it will send right away. There is no way round this, you need to find a way to queue the mail outside your page. This code will not send code on any day except the date given, it plainly won't wait to send it on that day.

          Christian Graus No longer a Microsoft MVP, but still happy to answer your questions.

          K 1 Reply Last reply
          0
          • C Christian Graus

            I love it when I tell people something and they ignore me. If you put the code in your page load, then it will send right away. There is no way round this, you need to find a way to queue the mail outside your page. This code will not send code on any day except the date given, it plainly won't wait to send it on that day.

            Christian Graus No longer a Microsoft MVP, but still happy to answer your questions.

            K Offline
            K Offline
            Kannan Coder
            wrote on last edited by
            #6

            Christian Graus wrote:

            I love it when I tell people something and they ignore me.

            I can understand your feelings. I am your silent follower for the last 2 years in codeproject. Now I remember a proverb. It is something like this “a wise man will be a fool among the fools”

            C 1 Reply Last reply
            0
            • K Kannan Coder

              Christian Graus wrote:

              I love it when I tell people something and they ignore me.

              I can understand your feelings. I am your silent follower for the last 2 years in codeproject. Now I remember a proverb. It is something like this “a wise man will be a fool among the fools”

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #7

              *sigh* yeah, isn't that the truth.

              Christian Graus No longer a Microsoft MVP, but still happy to answer your questions.

              K 1 Reply Last reply
              0
              • C Christian Graus

                *sigh* yeah, isn't that the truth.

                Christian Graus No longer a Microsoft MVP, but still happy to answer your questions.

                K Offline
                K Offline
                Kannan Coder
                wrote on last edited by
                #8

                I just want to give you a message that there are so many people here who consider you as a hero.

                E 1 Reply Last reply
                0
                • K Kannan Coder

                  I just want to give you a message that there are so many people here who consider you as a hero.

                  E Offline
                  E Offline
                  eyeseetee
                  wrote on last edited by
                  #9

                  Are you hugging the screen?

                  K 1 Reply Last reply
                  0
                  • E eyeseetee

                    Are you hugging the screen?

                    K Offline
                    K Offline
                    Kannan Coder
                    wrote on last edited by
                    #10

                    "If this is a sarcastic reply then I'm smiling to myself as you know what these people are like If this is a serious demand then I'm def not smiling!..." ;)

                    1 Reply Last reply
                    0
                    • S sugunavathysubramanian

                      hai mahesh, i am using sql server, string date = string.Format("{0:MM/dd/yyyy}", DateTime.Now); string senddate="27/7/2008"; if (senddate==date) { MailMessage mailMessage = new MailMessage(); mailMessage.From = ""; mailMessage.To = ""; mailMessage.Subject = "hai"; mailMessage.Body ="hello"; mailMessage.BodyFormat = MailFormat.Html; mailMessage.Priority = MailPriority.High; SmtpMail.Send(mailMessage); } i wrote code in page_load event.i host the project in server it will work or not. replay...thanks .

                      M Offline
                      M Offline
                      Member 3879881
                      wrote on last edited by
                      #11

                      Hi suguna, Try like this, String curdate = DateTime.Now.ToString(); string senddate="7/25/2008"; DateTime ld = Convert.ToDateTime(curdate); if (ld.Date == Convert.ToDateTime(senddate)) { Try Here ur Code } May be this one will help u By the way sorry MR.Graus We know ur genious..., But we are not that much genious, we are not getting what ur telling..., What to do still we are in basic not that much high level like u..., But sure later we too like u..........., Smile curve that sets everything straight..., Keep in touch,Dont be mood out of if they wont reply ur answers..., Keep going on we need ur knowledge

                      Thanks & Regards, NeW OnE, please don't forget to vote on the post

                      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