| | |
How to check if email address is valid
Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Dec 2008
Posts: 8
Reputation:
Solved Threads: 0
Hello,
I have a question. How can i determine if an email address is in the correct format. I use the System.Net.Mail.MailMessage to send my messages. I am getting my To email addresses from the database but when the address is not in the correct email format the program stops sending. How can i determine if its in correct format and if it is not then jump to the next.? Thanks.
I have a question. How can i determine if an email address is in the correct format. I use the System.Net.Mail.MailMessage to send my messages. I am getting my To email addresses from the database but when the address is not in the correct email format the program stops sending. How can i determine if its in correct format and if it is not then jump to the next.? Thanks.
•
•
•
•
Hello,
I have a question. How can i determine if an email address is in the correct format. I use the System.Net.Mail.MailMessage to send my messages. I am getting my To email addresses from the database but when the address is not in the correct email format the program stops sending. How can i determine if its in correct format and if it is not then jump to the next.? Thanks.
VB.NET Syntax (Toggle Plain Text)
public static bool IsValidEmailAddress(string sEmail) { if (sEmail == null) return false; else return Regex.IsMatch(sEmail, @" ^[-a-zA-Z0-9][-.a-zA-Z0-9]*@[-.a-zA-Z0-9]+(\.[-.a-zA-Z0-9]+)*\.(com|edu|info|gov|int|mil|net|org|biz|name|museum|coop|aero|pro|[a-zA-Z]{2})$",RegexOptions.IgnorePatternWhitespace); }
•
•
•
•
VB.NET Syntax (Toggle Plain Text)
public static bool IsValidEmailAddress(string sEmail) { if (sEmail == null) return false; else return Regex.IsMatch(sEmail, @" ^[-a-zA-Z0-9][-.a-zA-Z0-9]*@[-.a-zA-Z0-9]+(\.[-.a-zA-Z0-9]+)*\.(com|edu|info|gov|int|mil|net|org|biz|name|museum|coop|aero|pro|[a-zA-Z]{2})$",RegexOptions.IgnorePatternWhitespace); }
![]() |
Similar Threads
Other Threads in the VB.NET Forum
- Previous Thread: Visual Basic Code, I need Help!!!
- Next Thread: online railway reservation project in vb.net
| Thread Tools | Search this Thread |
.net .net2005 30minutes 2005 2008 access account arithmetic array basic binary bing button buttons center check code combobox component connectionstring crystalreport data database databasesearch datagrid datagridview date design dissertation dissertations dissertationthesis dropdownlist excel fade file-dialog folder ftp generatetags google gridview hardcopy image images input insert intel internet mobile monitor ms net networking objects output passingparameters peertopeervideostreaming picturebox picturebox1 port print problem problemwithinstallation project reports" save savedialog searchbox searchvb.net select serial shutdown soap survey table tcp temperature text textbox timer toolbox trim update updown user usercontrol vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web winforms wpf






