Questions tagged [email-validation]

Email validation is the process of deciding whether a given string is a valid email-address or not. This is distinct from email verification, which is necessary to determine if a given email address really exists, and (usually) whether a particular person has access to it (e.g. during an account signup process).

1243 questions
5476
votes
79 answers

How can I validate an email address in JavaScript?

I'd like to check if the user input is an email address in JavaScript, before sending it to a server or attempting to send an email to it, to prevent the most basic mistyping. How could I achieve this?
pix0r
  • 31,139
  • 18
  • 86
  • 102
838
votes
18 answers

What characters are allowed in an email address?

I'm not asking about full email validation. I just want to know what are allowed characters in user-name and server parts of email address. This may be oversimplified, maybe email adresses can take other forms, but I don't care. I'm asking about…
WildWezyr
  • 10,281
  • 6
  • 23
  • 28
610
votes
46 answers

C# code to validate email address

What is the most elegant code to validate that a string is a valid email address?
leora
  • 188,729
  • 360
  • 878
  • 1,366
370
votes
35 answers

How should I validate an e-mail address?

What's a good technique for validating an e-mail address (e.g. from a user input field) in Android? org.apache.commons.validator.routines.EmailValidator doesn't seem to be available. Are there any other libraries doing this which are included in…
znq
  • 44,613
  • 41
  • 116
  • 144
286
votes
15 answers

How to validate an email address in PHP

I have this function to validate an email addresses: function validateEMAIL($EMAIL) { $v = "/[a-zA-Z0-9_-.+]+@[a-zA-Z0-9-]+.[a-zA-Z]+/"; return (bool)preg_match($v, $EMAIL); } Is this okay for checking if the email address is valid or not?
Cameron
  • 27,963
  • 100
  • 281
  • 483
273
votes
18 answers

How to check for valid email address?

Is there a good way to check a form input using regex to make sure it is a proper style email address? Been searching since last night and everybody that has answered peoples questions regarding this topic also seems to have problems with it if it…
Bobby
  • 4,332
  • 5
  • 32
  • 39
244
votes
9 answers

Email Address Validation in Android on EditText

How can we perform Email Validation on edittext in android ? I have gone through google & SO but I didn't find out a simple way to validate it.
Rahul Baradia
  • 11,802
  • 17
  • 73
  • 121
201
votes
4 answers

Check that an email address is valid on iOS

Possible Duplicate: Best practices for validating email address in Objective-C on iOS 2.0? I am developing an iPhone application where I need the user to give his email address at login. What is the best way to check if an email address is a…
raaz
  • 12,410
  • 22
  • 64
  • 81
181
votes
12 answers

Email address validation using ASP.NET MVC data type attributes

I have some problems with the validation of a Email. In my Model: [Required(ErrorMessage = "Field can't be empty")] [DataType(DataType.EmailAddress, ErrorMessage = "E-mail is not valid")] public string ReceiverMail { get; set; } In my view:
Java Afca
  • 2,217
  • 4
  • 16
  • 10
178
votes
10 answers

Validating email addresses using jQuery and regex

I'm not too sure how to do this. I need to validate email addresses using regex with something like…
RussP
  • 1,973
  • 3
  • 16
  • 13
167
votes
13 answers

What are best practices for validating email addresses on iOS 2.0

What is the cleanest way to validate an email address that a user enters on iOS 2.0? NOTE: This is a historical question that is specific to iOS 2.0 and due to its age and how many other questions are linked to it it cannot be retired and MUST NOT…
Marcus S. Zarra
  • 46,571
  • 9
  • 101
  • 182
158
votes
9 answers

Why does HTML5 form-validation allow emails without a dot?

I'm writing a very simple mock-up to demonstrate some HTML5 form-validation. However, I noticed the email validation doesn't check for a dot in the address, nor does it check for characters following said dot. In other words, "john@doe" is…
WEFX
  • 8,298
  • 8
  • 66
  • 102
143
votes
16 answers

How to check if an email address exists without sending an email?

I have come across this PHP code to check email address using SMTP without sending an email. Has anyone tried anything similar or does it work for you? Can you tell if an email customer / user enters is correct & exists?
php-guy
  • 1,433
  • 2
  • 10
  • 6
129
votes
8 answers

How to validate an Email in PHP?

How can I validate the input value is a valid email address using php5. Now I am using this code function isValidEmail($email){ $pattern = "^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$"; if (eregi($pattern,…
learner
  • 2,099
  • 6
  • 23
  • 32
128
votes
20 answers

How to check edittext's text is email address or not?

how to check the text of edittext is email address or not without using javascript and regular expression? Here I used inputtype="textEmailAddress" this is working but no error message is display.
Dipak Keshariya
  • 22,193
  • 18
  • 76
  • 128
1
2 3
82 83