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. The Lounge
  3. What are you using?

What are you using?

Scheduled Pinned Locked Moved The Lounge
questioncsharphtmlasp-netcom
14 Posts 8 Posters 2 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.
  • A achimera

    Well, still it would be a cool subject for an article! :)

    C Offline
    C Offline
    code frog 0
    wrote on last edited by
    #5

    http://support.microsoft.com/kb/153119[^] This is pretty much what is going on in a nut shell...

    1 Reply Last reply
    0
    • C code frog 0

      I posted a question in the ASP .Net forums for a code answer but all my googling is telling me there isn't a code answer and this http://www.codeproject.com/aspnet/Valid_Email_Addresses.asp[^] doesn't work with all domains tested. I've found some "paid" libraries for $150 that I can buy but was wondering what if anything some of you might be using to validate email addresses? Regular expressions just test the format but don't actually attempt to connect to the SMTP server and get responses. This is what I use for manual verification http://www.zmailer.org/mxverify.html[^]. So I guess I'll put it like this. I'm cheap. When I first told the client I could do mail verification I thought the article here would be fine as it worked with all the private addresses I tested it with. Never in my wildest did I think it would fail with domains like gmail but it does. So now I'm up a creek as I don't want to spend money but the article here isn't going to cut it. So you got any cheap solutions?

      K Offline
      K Offline
      Kent Sharkey
      wrote on last edited by
      #6

      I'm obviously not getting something, but why not simply send out an email with a link to confirm the address (after the regex test)? Alternately, the only additional step that MX verify seems to be doing is something like this[^]

      -------------- TTFN - Kent

      1 Reply Last reply
      0
      • C code frog 0

        I posted a question in the ASP .Net forums for a code answer but all my googling is telling me there isn't a code answer and this http://www.codeproject.com/aspnet/Valid_Email_Addresses.asp[^] doesn't work with all domains tested. I've found some "paid" libraries for $150 that I can buy but was wondering what if anything some of you might be using to validate email addresses? Regular expressions just test the format but don't actually attempt to connect to the SMTP server and get responses. This is what I use for manual verification http://www.zmailer.org/mxverify.html[^]. So I guess I'll put it like this. I'm cheap. When I first told the client I could do mail verification I thought the article here would be fine as it worked with all the private addresses I tested it with. Never in my wildest did I think it would fail with domains like gmail but it does. So now I'm up a creek as I don't want to spend money but the article here isn't going to cut it. So you got any cheap solutions?

        E Offline
        E Offline
        Ed Poore
        wrote on last edited by
        #7

        A quick solution would be to use the existing zmailer.org script, if you issue a WebRequest to e.g:

        http://zmailer.org/cgi-bin/mxverify-cgi?DOMAIN=`{EMAILADDRESS}`&SUBMIT=SUBMIT+KV9.FI+NETWORK

        And then parse the result looking for the "Apparently OK" message. It might be worth asking them first just to check they have no problems, explain that it's a temporary stop-gap while you write it properly ;)

        1 Reply Last reply
        0
        • C code frog 0

          I posted a question in the ASP .Net forums for a code answer but all my googling is telling me there isn't a code answer and this http://www.codeproject.com/aspnet/Valid_Email_Addresses.asp[^] doesn't work with all domains tested. I've found some "paid" libraries for $150 that I can buy but was wondering what if anything some of you might be using to validate email addresses? Regular expressions just test the format but don't actually attempt to connect to the SMTP server and get responses. This is what I use for manual verification http://www.zmailer.org/mxverify.html[^]. So I guess I'll put it like this. I'm cheap. When I first told the client I could do mail verification I thought the article here would be fine as it worked with all the private addresses I tested it with. Never in my wildest did I think it would fail with domains like gmail but it does. So now I'm up a creek as I don't want to spend money but the article here isn't going to cut it. So you got any cheap solutions?

          M Offline
          M Offline
          M Harris
          wrote on last edited by
          #8

          This regex will verify any RFC 822 email address:) (?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] \x00-\x1F]+(?:(?: (?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\. |(?:(?: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))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?: (?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \

          G S 2 Replies Last reply
          0
          • M M Harris

            This regex will verify any RFC 822 email address:) (?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] \x00-\x1F]+(?:(?: (?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\. |(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t] )*(?:[^()<>@,;:\\".\[\] \x00-\x1F]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?= [\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"( ?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \ x00-\x1F]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\ [([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t]) *(?:[^()<>@,;:\\".\[\] \x00-\x1F]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[ \["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])* ))*|(?:[^()<>@,;:\\".\[\] \x00-\x1F]+(?:(?:(?:\r\n)?[ \t])+|\Z|( ?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))* "(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n)?[ \t])*(?:@(?:[^()<>@,;:\\". \[\] \x00-\x1F]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\ ]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[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?[ \t])*))*\>( ?:(?:\r\n)?[ \t])*)|(?:[^()<>@,;:\\".\[\] \x00-\x1F]+(?:(?:(?:\r \n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:( ?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*:(?:(?:\r\n)?[ \t])*(?:(?: (?:[^()<>@,;:\\".\[\] \x00-\x1F]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\ ["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?: (?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \

            G Offline
            G Offline
            Gary R Wheeler
            wrote on last edited by
            #9

            :omg:


            Software Zen: delete this;

            Fold With Us![^]

            1 Reply Last reply
            0
            • M M Harris

              This regex will verify any RFC 822 email address:) (?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] \x00-\x1F]+(?:(?: (?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\. |(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t] )*(?:[^()<>@,;:\\".\[\] \x00-\x1F]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?= [\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"( ?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \ x00-\x1F]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\ [([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t]) *(?:[^()<>@,;:\\".\[\] \x00-\x1F]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[ \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]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\ r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \x00-\x 1F]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[ \]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^ ()<>@,;:\\".\[\] \x00-\x1F]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()< >@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>( ?:(?:\r\n)?[ \t])*)|(?:[^()<>@,;:\\".\[\] \x00-\x1F]+(?:(?:(?:\r \n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:( ?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*:(?:(?:\r\n)?[ \t])*(?:(?: (?:[^()<>@,;:\\".\[\] \x00-\x1F]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\ ["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?: (?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \

              S Offline
              S Offline
              Scott Dorman
              wrote on last edited by
              #10

              It's very difficult to get a single Regex that will properly validate ALL of the possible variations in the RFC. There is a MailAddress[^] class available in .NET 2.0 that does a pretty good job of parsing an email address, but even that misses some of the more complex RFC patterns. The best way to do it is to actually write a tokenizer, but that is a lot of work. Why is full RFC compliance necessary? Generally you only need to validate the "commonly used" formats, which the MailAddress class should do for you.

              ----------------------------- In just two days, tomorrow will be yesterday.

              M 1 Reply Last reply
              0
              • C code frog 0

                I posted a question in the ASP .Net forums for a code answer but all my googling is telling me there isn't a code answer and this http://www.codeproject.com/aspnet/Valid_Email_Addresses.asp[^] doesn't work with all domains tested. I've found some "paid" libraries for $150 that I can buy but was wondering what if anything some of you might be using to validate email addresses? Regular expressions just test the format but don't actually attempt to connect to the SMTP server and get responses. This is what I use for manual verification http://www.zmailer.org/mxverify.html[^]. So I guess I'll put it like this. I'm cheap. When I first told the client I could do mail verification I thought the article here would be fine as it worked with all the private addresses I tested it with. Never in my wildest did I think it would fail with domains like gmail but it does. So now I'm up a creek as I don't want to spend money but the article here isn't going to cut it. So you got any cheap solutions?

                M Offline
                M Offline
                Mike Dimmick
                wrote on last edited by
                #11

                As a mail admin I'll point out that very few domains will actually handle the SMTP VRFY command, as of course spammers can use it to verify whether their mailing list is accurate. Those that do often implement tarpitting[^] to slow down the spammer. Exchange Server 2003 SP2 supports tarpitting when run on Windows Server 2003 SP1 (I know because I've implemented it). It won't help you for any of my email addresses, for my ISP will accept anything at my demon.co.uk subdomain. However, the MX refuses attempts to VRFY.

                Stability. What an interesting concept. -- Chris Maunder

                C 1 Reply Last reply
                0
                • M Mike Dimmick

                  As a mail admin I'll point out that very few domains will actually handle the SMTP VRFY command, as of course spammers can use it to verify whether their mailing list is accurate. Those that do often implement tarpitting[^] to slow down the spammer. Exchange Server 2003 SP2 supports tarpitting when run on Windows Server 2003 SP1 (I know because I've implemented it). It won't help you for any of my email addresses, for my ISP will accept anything at my demon.co.uk subdomain. However, the MX refuses attempts to VRFY.

                  Stability. What an interesting concept. -- Chris Maunder

                  C Offline
                  C Offline
                  code frog 0
                  wrote on last edited by
                  #12

                  Is it feasable that you could at least verify the domain was real?

                  M 1 Reply Last reply
                  0
                  • C code frog 0

                    Is it feasable that you could at least verify the domain was real?

                    M Offline
                    M Offline
                    Mike Dimmick
                    wrote on last edited by
                    #13

                    Yeah - do a DNS lookup for MX records for the domain. If present, it will accept email. I don't think you can do this with the Windows Sockets DNS APIs, though, you'll probably have to actually send a request to the DNS servers yourself. The IP Helper APIs will tell you what DNS server to use. You might find that source to an open-source version of nslookup is available, or some other library of DNS tools. You could probably screen-scrape the output of that command instead.

                    Stability. What an interesting concept. -- Chris Maunder

                    1 Reply Last reply
                    0
                    • S Scott Dorman

                      It's very difficult to get a single Regex that will properly validate ALL of the possible variations in the RFC. There is a MailAddress[^] class available in .NET 2.0 that does a pretty good job of parsing an email address, but even that misses some of the more complex RFC patterns. The best way to do it is to actually write a tokenizer, but that is a lot of work. Why is full RFC compliance necessary? Generally you only need to validate the "commonly used" formats, which the MailAddress class should do for you.

                      ----------------------------- In just two days, tomorrow will be yesterday.

                      M Offline
                      M Offline
                      M Harris
                      wrote on last edited by
                      #14

                      The regex i posted does validate every possible variation in the RFC. Hence why it is so very very very long (6.5kb). The regex comes from a perl module which does RFC validation on email addresses, i admit that it does go way way over the top. It also allows you to send an email to say, bob@home - which, while valid your server is probably never going to be able to deliver the mail to. But it will make sure that an email address is completely valid, no more mark.harris@itvision.com.au not being a valid email address, as so many websites say.

                      -- Real programmers don't comment their code. It was hard to write, it should be hard to understand.

                      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