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. Can't send mail on localhost

Can't send mail on localhost

Scheduled Pinned Locked Moved ASP.NET
8 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.
  • Y Offline
    Y Offline
    Yosh_
    wrote on last edited by
    #1

    hi guys, i try to send a mail like this: MailMessage mailMsg = new MailMessage(); mailMsg.From = new MailAddress("localhost", "Webmaster"); mailMsg.To.Add(new MailAddress("localhost", "Client guy")); mailMsg.Subject = "Message Subject"; mailMsg.Body = msgBody; mailMsg.IsBodyHtml = true; mailMsg.Priority = MailPriority.High; SmtpClient smtp = new SmtpClient("localhost"); smtp.Send(mailMsg); but then i get this error: <code>The specified string is not in the form required for an e-mail address. The smtp has already been set up from IIS. i just want to test how to send mail on my local system. how do i do this?

    He who goes for revenge must first dig two graves.

    Y P C N 4 Replies Last reply
    0
    • Y Yosh_

      hi guys, i try to send a mail like this: MailMessage mailMsg = new MailMessage(); mailMsg.From = new MailAddress("localhost", "Webmaster"); mailMsg.To.Add(new MailAddress("localhost", "Client guy")); mailMsg.Subject = "Message Subject"; mailMsg.Body = msgBody; mailMsg.IsBodyHtml = true; mailMsg.Priority = MailPriority.High; SmtpClient smtp = new SmtpClient("localhost"); smtp.Send(mailMsg); but then i get this error: <code>The specified string is not in the form required for an e-mail address. The smtp has already been set up from IIS. i just want to test how to send mail on my local system. how do i do this?

      He who goes for revenge must first dig two graves.

      Y Offline
      Y Offline
      Yusuf
      wrote on last edited by
      #2

      Creamboy wrote:

      The specified string is not in the form required for an e-mail address.

      This error means, there is something wrong with the email address you using. Make sure the email address is correct.

      Yusuf Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]

      Y 1 Reply Last reply
      0
      • Y Yusuf

        Creamboy wrote:

        The specified string is not in the form required for an e-mail address.

        This error means, there is something wrong with the email address you using. Make sure the email address is correct.

        Yusuf Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]

        Y Offline
        Y Offline
        Yosh_
        wrote on last edited by
        #3

        Yusuf.A wrote:

        This error means, there is something wrong with the email address you using. Make sure the email address is correct.

        I know that. I'm only really asking: what do i put in there to send a mail to my local server?

        He who goes for revenge must first dig two graves.

        Y 1 Reply Last reply
        0
        • Y Yosh_

          Yusuf.A wrote:

          This error means, there is something wrong with the email address you using. Make sure the email address is correct.

          I know that. I'm only really asking: what do i put in there to send a mail to my local server?

          He who goes for revenge must first dig two graves.

          Y Offline
          Y Offline
          Yusuf
          wrote on last edited by
          #4

          valid email address.

          Yusuf Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]

          1 Reply Last reply
          0
          • Y Yosh_

            hi guys, i try to send a mail like this: MailMessage mailMsg = new MailMessage(); mailMsg.From = new MailAddress("localhost", "Webmaster"); mailMsg.To.Add(new MailAddress("localhost", "Client guy")); mailMsg.Subject = "Message Subject"; mailMsg.Body = msgBody; mailMsg.IsBodyHtml = true; mailMsg.Priority = MailPriority.High; SmtpClient smtp = new SmtpClient("localhost"); smtp.Send(mailMsg); but then i get this error: <code>The specified string is not in the form required for an e-mail address. The smtp has already been set up from IIS. i just want to test how to send mail on my local system. how do i do this?

            He who goes for revenge must first dig two graves.

            P Offline
            P Offline
            PauloCastilho
            wrote on last edited by
            #5

            Creamboy wrote:

            mailMsg.From = new MailAddress("localhost", "Webmaster"); mailMsg.To.Add(new MailAddress("localhost", "Client guy"));

            Change "localhost" to a valid email address.

            1 Reply Last reply
            0
            • Y Yosh_

              hi guys, i try to send a mail like this: MailMessage mailMsg = new MailMessage(); mailMsg.From = new MailAddress("localhost", "Webmaster"); mailMsg.To.Add(new MailAddress("localhost", "Client guy")); mailMsg.Subject = "Message Subject"; mailMsg.Body = msgBody; mailMsg.IsBodyHtml = true; mailMsg.Priority = MailPriority.High; SmtpClient smtp = new SmtpClient("localhost"); smtp.Send(mailMsg); but then i get this error: <code>The specified string is not in the form required for an e-mail address. The smtp has already been set up from IIS. i just want to test how to send mail on my local system. how do i do this?

              He who goes for revenge must first dig two graves.

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

              It's like you know nothing about ASP.NET, the internet, or basic English comprehension.....

              Christian Graus Driven to the arms of OSX by Vista. "I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )

              1 Reply Last reply
              0
              • Y Yosh_

                hi guys, i try to send a mail like this: MailMessage mailMsg = new MailMessage(); mailMsg.From = new MailAddress("localhost", "Webmaster"); mailMsg.To.Add(new MailAddress("localhost", "Client guy")); mailMsg.Subject = "Message Subject"; mailMsg.Body = msgBody; mailMsg.IsBodyHtml = true; mailMsg.Priority = MailPriority.High; SmtpClient smtp = new SmtpClient("localhost"); smtp.Send(mailMsg); but then i get this error: <code>The specified string is not in the form required for an e-mail address. The smtp has already been set up from IIS. i just want to test how to send mail on my local system. how do i do this?

                He who goes for revenge must first dig two graves.

                N Offline
                N Offline
                nithydurai
                wrote on last edited by
                #7

                MailMessage mail = new MailMessage(); mail.To.Add("demo@gmail.com"); mail.From = new System.Net.Mail.MailAddress("from@gmail.com"); mail.Subject = "Subject"; mail.Body = "hello, this is test mail"; mail.IsBodyHtml = true; SmtpClient client = new SmtpClient(server name); client.Credentials = new NetworkCredential("username", "password"); client.Send(mail); Response.Write("send mail!");

                A 1 Reply Last reply
                0
                • N nithydurai

                  MailMessage mail = new MailMessage(); mail.To.Add("demo@gmail.com"); mail.From = new System.Net.Mail.MailAddress("from@gmail.com"); mail.Subject = "Subject"; mail.Body = "hello, this is test mail"; mail.IsBodyHtml = true; SmtpClient client = new SmtpClient(server name); client.Credentials = new NetworkCredential("username", "password"); client.Send(mail); Response.Write("send mail!");

                  A Offline
                  A Offline
                  archit3000
                  wrote on last edited by
                  #8

                  I'm also doing the same, but the mail goes to the Queue folder only.... what to do???

                  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