homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / WebmasterWorld / Webmaster General
Forum Library, Charter, Moderators: phranque

Webmaster General Forum

Can email addresses contain apostrophes?
I've come across an email address with an apostrophe - what do I do?

5+ Year Member

Msg#: 3014650 posted 4:07 pm on Jul 19, 2006 (gmt 0)

Here's the situation.

We've got an online application, with a place where people can register (Supply their name, email, etc).

Some fella is complaining that it won't accept his email address. After looking into it, turns out his email address is joe.o'bloggs@domain.com. It's got an apostrophe in it.

I've never come across this before! The validation we've got doesn't allow that sort of punctuation.

(To avoid blame, I personally didn't write this application, although I must admit I would have done it exactly the same way!)

My question is - is it common for email addresses to contain apostrophes? Or am I allowed to tell him to get a proper email address (allocated to him by his company)? I don't mind modding our application to allow this, but if this is going to be a one-off, I don't know if it's worth my effort.

I've hunted around for specifications on what email addresses can contain, but no joy. If anyone's got one, please sticky me if you can't post it!

Cheers guys,


(Forgive me if this is in the wrong forum...I tried my best!)



10+ Year Member

Msg#: 3014650 posted 4:32 pm on Jul 19, 2006 (gmt 0)

RFC2821 and RFC2822 state clearly that only 7bit ASCII characters are allowed in Internet mail addresses.

it looks like the --> ' <--- is allowed...

Here's a list of all the characters and a short explaination...


hope that helps...

[edited by: trillianjedi at 4:39 pm (utc) on July 19, 2006]
[edit reason]
[1][edit reason] Please don't obfuscate links - if within TOS, link in full. Thanks ;) [/edit]


10+ Year Member

Msg#: 3014650 posted 4:42 pm on Jul 19, 2006 (gmt 0)

[edit: beaten to the answer! Anyway, here is what I found]

RFC 2822:

...the local-part of the e-mail may use any of these ASCII characters:

* Uppercase and lowercase letters
* The digits 0 through 9
* The characters,! # $ % & ' * + - / =? ^ _ ` { } ~
* The character "." provided that it is not the first or last character in the local-part.

You can read the full specification at [tools.ietf.org ]


5+ Year Member

Msg#: 3014650 posted 6:18 am on Jul 20, 2006 (gmt 0)

E-mail addresses can be a good deal more complicated than that, actually. For instance, "bob@myhost.com"@example.com is a perfectly valid e-mail address. It is identical to "bob\@myhost.com"@example.com and "bob@myhost.com"@eXaMpLe.CoM, but may be different from "Bob@myHost.com"@example.com. That said, it's a pretty rare web form which can handle such monstrosities.

RFC 2822 [faqs.org] is a fun read, if you like that sort of thing. The ROI drops significantly the closer you get to full RFC compliance, and I've yet to come across anyone with an e-mail address which actually required a quoted-string local-part (a dot-atom local-part covers every e-mail address I've ever seen, and then some), but it's nice to know the sort of corner cases you're leaving out. :)

dot-atom, local-part, and quoted-string are all defined in RFC 2822. Really, go read it. It hasn't been mentioned by three separate people by coincidence. ;)


5+ Year Member

Msg#: 3014650 posted 10:06 am on Jul 20, 2006 (gmt 0)

Cheers guys! What a great response!

I get a feeling this is going to cause us a tad more work...we've got loads of applications here that use email addresses in some form...suppose I need to go through them all and make sure they can accept all these crazy...*ahem*...obscure addresses!

Thanks for all the info guys - those links really help!


Global Options:
 top home search open messages active posts  

Home / Forums Index / WebmasterWorld / Webmaster General
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved