Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do all valid emails contain at least one @ symbol?

I'm not trying to come up with full email validation. I'm trying to prevent a specific problem:

I've had users use the contact form on my website, which asks for "Name", "Email" and "Message", and just by hilarious mistake, I get the info, "First Name", "Last Name", "Message", and I think to myself, 'Shit where did I leave my Yellow Pages?'

So, I don't want to validate email, I just want to remind people that it's not last name we're asking for it's email.

I'm thinking I check for an @ symbol, and I want to make sure I'm not neglecting valid emails.

Are there valid emails with no @ symbols in them?

like image 318
Costa Michailidis Avatar asked Jan 16 '15 06:01

Costa Michailidis


People also ask

Is a valid symbol in email?

A valid email address consists of an email prefix and an email domain, both in acceptable formats. The prefix appears to the left of the @ symbol. The domain appears to the right of the @ symbol. For example, in the address [email protected], "example" is the email prefix, and "mail.com" is the email domain.

Can an email address have 2 symbols?

As far as I'm aware, you can only have one. The @ symbol is the delimiter between the domain name and the address name; multiple @ symbols would very likely confuse the email parser. Do you by "email id" mean an address?

How many characters is a valid email address?

The format of email addresses is local-part@domain where the local-part may be up to 64 characters long and the domain name may have a maximum of 253 characters - but the maximum 256 characters length of a forward or reverse path restricts the entire email address to be no more than 254 characters.

How do I know if an email address is valid?

Email Checker is a simple little tool for verifying an email address. It's free and quite easy to use. Just enter the email address and hit the check button. It tells you whether the email id is real or fake.


2 Answers

As per RFC5322:

An addr-spec is a specific Internet identifier that contains a locally interpreted string followed by the at-sign character ("@", ASCII value 64) followed by an Internet domain.

So, yes, all email addresses must have the @ character.

Prior to the internet taking over the world, it was possible for email addresses to have other formats, like the FidoNet mail address 1:170/918.10, user number 10 at FidoNet node 1:170/918.

But given the ratio of internet users to FidoNet users currently stands at about a gazillion or more to one, that's for historical interest only.

like image 131
paxdiablo Avatar answered Sep 19 '22 04:09

paxdiablo


As defined in RFC5322, section 3.4.1:

An addr-spec is a specific Internet identifier that contains a locally interpreted string followed by the at-sign character ("@", ASCII value 64) followed by an Internet domain.

https://www.rfc-editor.org/rfc/rfc5322

like image 42
cafonso Avatar answered Sep 20 '22 04:09

cafonso