Results 1 to 4 of 4

Thread: How to Verify That Strings Are in Valid E-Mail Format.

  1. #1
    Herry Markowitz's Avatar
    Herry Markowitz is offline VB.NET Forum Enthusiast
    .NET Framework
    .NET 4.0
    Join Date
    Oct 2015
    Posts
    38
    Reputation
    20

    How to Verify That Strings Are in Valid E-Mail Format.

    Following link explains How to Verify That Strings Are in Valid E-Mail Format.

    The code in the following link very complicated for me to understand.

    https://msdn.microsoft.com/en-us/lib...v=vs.100).aspx

    Could you please send me a file which is ready to use for Windows Form Application with Form Load Event or Button Click Event.

    Thank you very much.

    My system;
    Windows Form Application
    .Net Framework 4
    Last edited by JohnH; 12-11-2016 at 4:33 PM. Reason: removed email address
    I am VBA expert.
    I am trying to be vb.net expert.

  2. #2
    JohnH's Avatar
    JohnH is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.5
    Join Date
    Dec 2005
    Location
    Norway
    Posts
    15,083
    Reputation
    2803
    Just load the address into MailAddress class, it will validate for you. Use Try-Catch for when address is not in a recognized format.
    MailAddress Constructor (String) (System.Net.Mail)
    How to format posts with code blocks etc - present the problem/post properly

    Visual Studio Community 2017

  3. #3
    Herry Markowitz's Avatar
    Herry Markowitz is offline VB.NET Forum Enthusiast
    .NET Framework
    .NET 4.0
    Join Date
    Oct 2015
    Posts
    38
    Reputation
    20
    Thanks JohnH,
    But I really dont understand how to run it.
    Could you please send me a file which is ready to use for Windows Form Application with Form Load Event or Button Click Event.
    I am VBA expert.
    I am trying to be vb.net expert.

  4. #4
    JohnH's Avatar
    JohnH is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.5
    Join Date
    Dec 2005
    Location
    Norway
    Posts
    15,083
    Reputation
    2803
    You create a new MailAdress object and pass the address string as argument, no rocket science exactly.
    How to: Use the New Keyword
    How to: Pass Arguments to a Procedure (Visual Basic)
    How to: Use the Try/Catch Block to Catch Exceptions
    How to format posts with code blocks etc - present the problem/post properly

    Visual Studio Community 2017

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •