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. General Programming
  3. C#
  4. send mail using C#

send mail using C#

Scheduled Pinned Locked Moved C#
csharpcom
9 Posts 6 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 Offline
    S Offline
    sobhaniir
    wrote on last edited by
    #1

    hi i want to send mail using C# but i cant this is my code: MailAddress from = new MailAddress("negin_sarkhosh22@yahoo.com", ":: safir187.com ::"); MailAddress to = new MailAddress("sara_sarakhanom22@yahoo.com", ":: tnz187 ::"); MailMessage message = new MailMessage(from, to); message.Subject = "Safir187.com is updated!"; message.IsBodyHtml = true; message.Priority = MailPriority.High; message.Body = "wedqwe"; SmtpClient client = new SmtpClient("localhost"); client.Send(message); please tell me my mistake thanks

    G W M 3 Replies Last reply
    0
    • S sobhaniir

      hi i want to send mail using C# but i cant this is my code: MailAddress from = new MailAddress("negin_sarkhosh22@yahoo.com", ":: safir187.com ::"); MailAddress to = new MailAddress("sara_sarakhanom22@yahoo.com", ":: tnz187 ::"); MailMessage message = new MailMessage(from, to); message.Subject = "Safir187.com is updated!"; message.IsBodyHtml = true; message.Priority = MailPriority.High; message.Body = "wedqwe"; SmtpClient client = new SmtpClient("localhost"); client.Send(message); please tell me my mistake thanks

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      What does "cant" really mean? Does the code compile? What happens when you run it? Do you get an error message? Does the server have an active SMTP service? Does your ISP allow sending mails through their system? This is sometimes disallowed to prevent spamming. In that case you have to use the SMTP server that they provide.

      Despite everything, the person most likely to be fooling you next is yourself.

      L 1 Reply Last reply
      0
      • G Guffa

        What does "cant" really mean? Does the code compile? What happens when you run it? Do you get an error message? Does the server have an active SMTP service? Does your ISP allow sending mails through their system? This is sometimes disallowed to prevent spamming. In that case you have to use the SMTP server that they provide.

        Despite everything, the person most likely to be fooling you next is yourself.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Why do people vote this as an unhelpful answer? I'll vote this one as helpful for justice.

        P 1 Reply Last reply
        0
        • S sobhaniir

          hi i want to send mail using C# but i cant this is my code: MailAddress from = new MailAddress("negin_sarkhosh22@yahoo.com", ":: safir187.com ::"); MailAddress to = new MailAddress("sara_sarakhanom22@yahoo.com", ":: tnz187 ::"); MailMessage message = new MailMessage(from, to); message.Subject = "Safir187.com is updated!"; message.IsBodyHtml = true; message.Priority = MailPriority.High; message.Body = "wedqwe"; SmtpClient client = new SmtpClient("localhost"); client.Send(message); please tell me my mistake thanks

          W Offline
          W Offline
          Wendelius
          wrote on last edited by
          #4

          As the previous post pointed out you should describe your problem better. Just based on the code I noticed that you are using localhost as the mail server. Is this correct, in other words do you have a smtp mail server running on your client? Mika

          1 Reply Last reply
          0
          • L Lost User

            Why do people vote this as an unhelpful answer? I'll vote this one as helpful for justice.

            P Offline
            P Offline
            Paul Conrad
            wrote on last edited by
            #5

            I think the OP voted it down because it wasn't the answer HE was looking for.

            "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

            L 1 Reply Last reply
            0
            • S sobhaniir

              hi i want to send mail using C# but i cant this is my code: MailAddress from = new MailAddress("negin_sarkhosh22@yahoo.com", ":: safir187.com ::"); MailAddress to = new MailAddress("sara_sarakhanom22@yahoo.com", ":: tnz187 ::"); MailMessage message = new MailMessage(from, to); message.Subject = "Safir187.com is updated!"; message.IsBodyHtml = true; message.Priority = MailPriority.High; message.Body = "wedqwe"; SmtpClient client = new SmtpClient("localhost"); client.Send(message); please tell me my mistake thanks

              M Offline
              M Offline
              mr mohsen
              wrote on last edited by
              #6

              hi i guess that you are iranian. your ids name i guess that your mailserver is not active or you mistake to input mailserver name correctly. tell your problem completely to anyone can help u. salam man hads mizanam shoma bayad ye iranie aziz bashid man fekr mikonam ya mailserveretoon faal nist ya shoma dar vared kardanesh eshtebah mikonid be har hal hamoontor ke doostan goftand behtare ke moshgeletoono vazehtar onvan konid.

              nobody help you... you have to help you yourself and this is success way.

              1 Reply Last reply
              0
              • P Paul Conrad

                I think the OP voted it down because it wasn't the answer HE was looking for.

                "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                Yeah, seems to be pretty common these days :sigh:

                P 1 Reply Last reply
                0
                • L Lost User

                  Yeah, seems to be pretty common these days :sigh:

                  P Offline
                  P Offline
                  Paul Conrad
                  wrote on last edited by
                  #8

                  Yeah, over in the ASP.NET forum somebody vote me down just because I told them to get a book or two on programming in ASP.NET since they were a beginner asking an incredibly trivial question.

                  "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

                  G 1 Reply Last reply
                  0
                  • P Paul Conrad

                    Yeah, over in the ASP.NET forum somebody vote me down just because I told them to get a book or two on programming in ASP.NET since they were a beginner asking an incredibly trivial question.

                    "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

                    G Offline
                    G Offline
                    Guffa
                    wrote on last edited by
                    #9

                    Well, if people don't want to be part of the process of helping them, what can you do... It's quite common that people don't know what to ask for, how to ask for it, or what information to provide when asking for it. That's all right if they just respond when asked for clarification or more information. If they don't, the thread is not going to go anywhere. At least not in the direction of helping them...

                    Despite everything, the person most likely to be fooling you next is yourself.

                    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