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. sending Email in C#

sending Email in C#

Scheduled Pinned Locked Moved ASP.NET
csharpcomsysadminwindows-adminhelp
15 Posts 4 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.
  • K kvsreedhar

    anyone over there please help I was trying sending Email in C# the code goes this way... string smtp = "localhost"; System.Net.Mail.SmtpClient smtpClient = new System.Net.Mail.SmtpClient(smtp); System.Net.Mail.MailMessage objEmail = new System.Net.Mail.MailMessage(); objEmail.To.Add(txtEmail.Text); //to@domain.com objEmail.From = new System.Net.Mail.MailAddress(txtFrom.Text, "kv"); //from@domain.com objEmail.Subject = "Test Email For DOT NET"; objEmail.Body = txtMessage.Text; //some body objEmail.Priority = System.Net.Mail.MailPriority.High; //SmtpMail.SmtpServer = "localhost"; try { smtpClient.Send(objEmail); Response.Write("Your Email has been sent sucessfully -Thank You"); } catch (Exception exc) { Response.Write("Send failure: " + exc.ToString()); } ----but my doubt is When the code is run I am getting a message "Your Email has been sent sucessfully -Thank You" but when checked the mail I don't find the mail sent in inbox. I am using localhost as SMTP server . May please help me in this . Also I have configured the SMTP server to 127.0.0.1 (AdminTools->IIS->Default SMTP Virtual Server->properties->access->relay->127.0.0.1). I found the SMTP working in my system.But the mail can't be found in the Inbox of the recepient(it's my own mail) :rose: Thanking in advance :rose:

    Kovuru Sreedhar

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

    Have you checked in the spam/bulk ?

    All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

    K 1 Reply Last reply
    0
    • K kvsreedhar

      anyone over there please help I was trying sending Email in C# the code goes this way... string smtp = "localhost"; System.Net.Mail.SmtpClient smtpClient = new System.Net.Mail.SmtpClient(smtp); System.Net.Mail.MailMessage objEmail = new System.Net.Mail.MailMessage(); objEmail.To.Add(txtEmail.Text); //to@domain.com objEmail.From = new System.Net.Mail.MailAddress(txtFrom.Text, "kv"); //from@domain.com objEmail.Subject = "Test Email For DOT NET"; objEmail.Body = txtMessage.Text; //some body objEmail.Priority = System.Net.Mail.MailPriority.High; //SmtpMail.SmtpServer = "localhost"; try { smtpClient.Send(objEmail); Response.Write("Your Email has been sent sucessfully -Thank You"); } catch (Exception exc) { Response.Write("Send failure: " + exc.ToString()); } ----but my doubt is When the code is run I am getting a message "Your Email has been sent sucessfully -Thank You" but when checked the mail I don't find the mail sent in inbox. I am using localhost as SMTP server . May please help me in this . Also I have configured the SMTP server to 127.0.0.1 (AdminTools->IIS->Default SMTP Virtual Server->properties->access->relay->127.0.0.1). I found the SMTP working in my system.But the mail can't be found in the Inbox of the recepient(it's my own mail) :rose: Thanking in advance :rose:

      Kovuru Sreedhar

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

      Try sending the e-mail to a different account, it could be that your current account is blocking the e-mail. Also try hardcoding your e-mail address in the to box to test

      K 1 Reply Last reply
      0
      • N N a v a n e e t h

        Have you checked in the spam/bulk ?

        All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

        K Offline
        K Offline
        kvsreedhar
        wrote on last edited by
        #4

        yes I did checked in spam/bulk also. bye the bye please tell me what does this mean and why "All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems" in the beginning means where to write the code ,is it load event?

        Kovuru Sreedhar

        E M 2 Replies Last reply
        0
        • K kvsreedhar

          yes I did checked in spam/bulk also. bye the bye please tell me what does this mean and why "All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems" in the beginning means where to write the code ,is it load event?

          Kovuru Sreedhar

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

          kvsreedhar wrote:

          All C# applications should call Application.Quit();

          I dont think he like c#

          K 1 Reply Last reply
          0
          • E eyeseetee

            Try sending the e-mail to a different account, it could be that your current account is blocking the e-mail. Also try hardcoding your e-mail address in the to box to test

            K Offline
            K Offline
            kvsreedhar
            wrote on last edited by
            #6

            tried it but the same result . i even hard coded the mail address

            Kovuru Sreedhar

            1 Reply Last reply
            0
            • K kvsreedhar

              yes I did checked in spam/bulk also. bye the bye please tell me what does this mean and why "All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems" in the beginning means where to write the code ,is it load event?

              Kovuru Sreedhar

              M Offline
              M Offline
              Manas Bhardwaj
              wrote on last edited by
              #7

              kvsreedhar wrote:

              bye the bye please tell me what does this mean

              By the way... ;P

              kvsreedhar wrote:

              All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems

              I really do not know what adjective to use for you. In between, that was a joke. :-D

              Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

              K N 2 Replies Last reply
              0
              • E eyeseetee

                kvsreedhar wrote:

                All C# applications should call Application.Quit();

                I dont think he like c#

                K Offline
                K Offline
                kvsreedhar
                wrote on last edited by
                #8

                literally I don't understand ur words . if u have ans to Application.Quit() pl. tell me.

                Kovuru Sreedhar

                E 1 Reply Last reply
                0
                • K kvsreedhar

                  literally I don't understand ur words . if u have ans to Application.Quit() pl. tell me.

                  Kovuru Sreedhar

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

                  Its a joke. Calling Application.Quit() means the app will never run.

                  K 1 Reply Last reply
                  0
                  • M Manas Bhardwaj

                    kvsreedhar wrote:

                    bye the bye please tell me what does this mean

                    By the way... ;P

                    kvsreedhar wrote:

                    All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems

                    I really do not know what adjective to use for you. In between, that was a joke. :-D

                    Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

                    K Offline
                    K Offline
                    kvsreedhar
                    wrote on last edited by
                    #10

                    I would be more happy with your answer for Application.quit() :)

                    Kovuru Sreedhar

                    1 Reply Last reply
                    0
                    • E eyeseetee

                      Its a joke. Calling Application.Quit() means the app will never run.

                      K Offline
                      K Offline
                      kvsreedhar
                      wrote on last edited by
                      #11

                      :laugh: really I laughed on My Ignorance of the subject(App.Quit()). :laugh: Any how please help me with email .

                      Kovuru Sreedhar

                      E 1 Reply Last reply
                      0
                      • K kvsreedhar

                        :laugh: really I laughed on My Ignorance of the subject(App.Quit()). :laugh: Any how please help me with email .

                        Kovuru Sreedhar

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

                        I suggest you create a simple page and just use the code from this site to test. Try using different e-mail address as well with this code http://www.aspheute.com/english/20000918.asp

                        1 Reply Last reply
                        0
                        • M Manas Bhardwaj

                          kvsreedhar wrote:

                          bye the bye please tell me what does this mean

                          By the way... ;P

                          kvsreedhar wrote:

                          All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems

                          I really do not know what adjective to use for you. In between, that was a joke. :-D

                          Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

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

                          Looks like I have to put a joke smiley next to my sig

                          All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

                          M 1 Reply Last reply
                          0
                          • N N a v a n e e t h

                            Looks like I have to put a joke smiley next to my sig

                            All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

                            M Offline
                            M Offline
                            Manas Bhardwaj
                            wrote on last edited by
                            #14

                            N a v a n e e t h wrote:

                            Looks like I have to put a joke smiley next to my sig

                            Well, actually not. You rarely get to see these type of icons :laugh:

                            Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

                            K 1 Reply Last reply
                            0
                            • M Manas Bhardwaj

                              N a v a n e e t h wrote:

                              Looks like I have to put a joke smiley next to my sig

                              Well, actually not. You rarely get to see these type of icons :laugh:

                              Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

                              K Offline
                              K Offline
                              kvsreedhar
                              wrote on last edited by
                              #15

                              :) you are Too Smart MB :)

                              Kovuru Sreedhar

                              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