Click here to Skip to main content
Sign Up to vote bad
good
See more: C#ASP.NET
hell all
 
i am sending a mail for this i am entering text in multipletextbox . how to find whether any
email address or mobilenumber is exists in multilinetextbox or not. on click event of sendmail button. please tell me any one.
 
Thanks
Posted 11 Feb '13 - 3:17


1 solution

You can't check if an email address exists (in the sense that any message sent to it can be read) in any way other than to send a message to it and see if you get a reply.
You can however check if there is a valid email address in the textbox:
public static Regex regex = new Regex(
      "([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1"+
      ",3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})",
    RegexOptions.IgnoreCase
    | RegexOptions.CultureInvariant
    | RegexOptions.IgnorePatternWhitespace
    | RegexOptions.Compiled
    );
 
Match m = regex.Match(myTextBox.Text);
if (m.Success)
   {
   // OK
   }
  Permalink  
Comments
Edo Tzumer - 11 Feb '13 - 9:33
5+
Maciej Los - 11 Feb '13 - 10:05
+5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 394
1 Mahesh Bailwal 353
2 Maciej Los 285
3 CPallini 245
4 Rohan Leuva 175
0 Sergey Alexandrovich Kryukov 9,287
1 OriginalGriff 7,204
2 CPallini 3,923
3 Rohan Leuva 3,211
4 Maciej Los 2,713


Advertise | Privacy | Mobile
Web02 | 2.6.130516.1 | Last Updated 11 Feb 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid