Email-address validation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mika M

    Email-address validation

    Simple question: Does Framework (1.1) contain any routine to check entered
    email-address is valid ?

    It's quite easy to make own code for that purpose, but why to do if
    Framework (1.1) contain this kind of routine.

    --
    Thanks in advance!

    Mika


  • Shiva

    #2
    Re: Email-address validation

    Hi,
    You can use regular expressions for that. Check out the
    System.Text.Reg ularExpressions namespace in the FCL. You can get regular
    expressions for various pattern and format validations from many web sites.
    One such site is http://www.regexlib.com/

    HTH

    "Mika M" <mika.mahonen@n ospam_kolumbus. fi> wrote in message
    news:OCAN530uEH A.1524@TK2MSFTN GP09.phx.gbl...
    Simple question: Does Framework (1.1) contain any routine to check entered
    email-address is valid ?

    It's quite easy to make own code for that purpose, but why to do if
    Framework (1.1) contain this kind of routine.

    --
    Thanks in advance!

    Mika



    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: Email-address validation

      "Mika M" <mika.mahonen@n ospam_kolumbus. fi> schrieb:[color=blue]
      > Simple question: Does Framework (1.1) contain any routine to check entered
      > email-address is valid ?[/color]

      No.
      [color=blue]
      > It's quite easy to make own code for that purpose[/color]

      Are you sure?!

      Parsing Email Addresses using an RFC822 Compliant Address Validator
      <URL:http://www.codeproject .com/csharp/RFC822Validator .asp>

      --
      Herfried K. Wagner [MVP]
      <URL:http://dotnet.mvps.org/>


      Comment

      • scorpion53061

        #4
        Re: Email-address validation

        Dim regValidEmail As New
        System.Text.Reg ularExpressions .Regex("^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$")

        If Not regValidEmail.I sMatch(Variable Checked) Then
        MsgBox("That is incorrect. The Packers will win the super
        bowl.")
        End If

        "Mika M" <mika.mahonen@n ospam_kolumbus. fi> wrote in message
        news:OCAN530uEH A.1524@TK2MSFTN GP09.phx.gbl:[color=blue]
        > Simple question: Does Framework (1.1) contain any routine to check entered
        >
        > email-address is valid ?
        >
        > It's quite easy to make own code for that purpose, but why to do if
        > Framework (1.1) contain this kind of routine.
        >[/color]

        Comment

        • steve

          #5
          Re: Email-address validation

          | > It's quite easy to make own code for that purpose
          |
          | Are you sure?!

          don't be a smart-ass herf! is it quite easy to validate email addresses no
          matter what rfc you design your code after...and, 822 is the simplest. you
          could have at least chosen a harder one to support your smugness.

          why are you an "mvp"?


          Comment

          • steve

            #6
            Re: Email-address validation

            good attempt but not fully rfc compliant...doe sn't handle:

            joe blow <jblow@abc.co m>
            "super dave osborne"@abc.co m
            snoozing.susan@ abc.com

            etc., etc., etc.


            Comment

            • scorpion53061

              #7
              Re: Email-address validation

              Dim regValidEmail As New
              System.Text.Reg ularExpressions .Regex("^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$")

              If Not regValidEmail.I sMatch(Variable Checked) Then
              MsgBox("That is incorrect. The Packers will win the super
              bowl.")
              End If

              "Mika M" <mika.mahonen@n ospam_kolumbus. fi> wrote in message
              news:OCAN530uEH A.1524@TK2MSFTN GP09.phx.gbl:[color=blue]
              > Simple question: Does Framework (1.1) contain any routine to check entered
              >
              > email-address is valid ?
              >
              > It's quite easy to make own code for that purpose, but why to do if
              > Framework (1.1) contain this kind of routine.
              >[/color]

              Comment

              • steve

                #8
                Re: Email-address validation

                | > It's quite easy to make own code for that purpose
                |
                | Are you sure?!

                don't be a smart-ass herf! is it quite easy to validate email addresses no
                matter what rfc you design your code after...and, 822 is the simplest. you
                could have at least chosen a harder one to support your smugness.

                why are you an "mvp"?


                Comment

                • steve

                  #9
                  Re: Email-address validation

                  good attempt but not fully rfc compliant...doe sn't handle:

                  joe blow <jblow@abc.co m>
                  "super dave osborne"@abc.co m
                  snoozing.susan@ abc.com

                  etc., etc., etc.


                  Comment

                  • Herfried K. Wagner [MVP]

                    #10
                    Re: Email-address validation

                    "steve" <a@b.com> schrieb:[color=blue]
                    > | > It's quite easy to make own code for that purpose
                    > |
                    > | Are you sure?!
                    >
                    > don't be a smart-ass herf! is it quite easy to validate email addresses no
                    > matter what rfc you design your code after...[/color]

                    Well, I would not consider writing the regular expression for RFC compliant
                    email address validation an "easy" job:

                    <URL:http://groups.google.de/groups?selm=...TK2MSFTNGP12.p
                    hx.gbl>
                    [color=blue]
                    > and, 822 is the simplest. you could have at least chosen a harder
                    > one to support your smugness.[/color]

                    ?!?

                    --
                    Herfried K. Wagner [MVP]
                    <URL:http://dotnet.mvps.org/>


                    Comment

                    • Herfried K. Wagner [MVP]

                      #11
                      Re: Email-address validation

                      "steve" <a@b.com> schrieb:[color=blue]
                      > | > It's quite easy to make own code for that purpose
                      > |
                      > | Are you sure?!
                      >
                      > don't be a smart-ass herf! is it quite easy to validate email addresses no
                      > matter what rfc you design your code after...[/color]

                      Well, I would not consider writing the regular expression for RFC compliant
                      email address validation an "easy" job:

                      <URL:http://groups.google.de/groups?selm=...TK2MSFTNGP12.p
                      hx.gbl>
                      [color=blue]
                      > and, 822 is the simplest. you could have at least chosen a harder
                      > one to support your smugness.[/color]

                      ?!?

                      --
                      Herfried K. Wagner [MVP]
                      <URL:http://dotnet.mvps.org/>


                      Comment

                      • scorpion53061

                        #12
                        Re: Email-address validation

                        What did not "handle"?



                        "steve" <a@b.com> wrote in message
                        news:10nslq79hi o160d@corp.supe rnews.com:[color=blue]
                        > good attempt but not fully rfc compliant...doe sn't handle:
                        >
                        > joe blow <jblow@abc.co m>
                        > "super dave osborne"@abc.co m
                        > snoozing.susan@ abc.com
                        >
                        > etc., etc., etc.[/color]

                        Comment

                        • scorpion53061

                          #13
                          Re: Email-address validation

                          Ok I would like to see your solution please.


                          "steve" <a@b.com> wrote in message
                          news:10nslq79hi o160d@corp.supe rnews.com:[color=blue]
                          > good attempt but not fully rfc compliant...doe sn't handle:
                          >
                          > joe blow <jblow@abc.co m>
                          > "super dave osborne"@abc.co m
                          > snoozing.susan@ abc.com
                          >
                          > etc., etc., etc.[/color]

                          Comment

                          • scorpion53061

                            #14
                            Re: Email-address validation

                            What did not "handle"?



                            "steve" <a@b.com> wrote in message
                            news:10nslq79hi o160d@corp.supe rnews.com:[color=blue]
                            > good attempt but not fully rfc compliant...doe sn't handle:
                            >
                            > joe blow <jblow@abc.co m>
                            > "super dave osborne"@abc.co m
                            > snoozing.susan@ abc.com
                            >
                            > etc., etc., etc.[/color]

                            Comment

                            • scorpion53061

                              #15
                              Re: Email-address validation

                              Why aren't you an MVP?

                              Why are you dumping on Herfried?

                              "steve" <a@b.com> wrote in message
                              news:10nslje4fs p9i2f@corp.supe rnews.com:[color=blue]
                              > | > It's quite easy to make own code for that purpose
                              > |
                              > | Are you sure?!
                              >
                              > don't be a smart-ass herf! is it quite easy to validate email addresses no
                              >
                              > matter what rfc you design your code after...and, 822 is the simplest. you
                              >
                              > could have at least chosen a harder one to support your smugness.
                              >
                              > why are you an "mvp"?[/color]

                              Comment

                              Working...