Welcome to Dream.In.Code
Getting Help is Easy!

Join 132,648 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,122 people online right now. Registration is fast and FREE... Join Now!




Capitals in a email address

 
Reply to this topicStart new topic

Capitals in a email address, Can I lowercase all email addresses?

swichnz
post 11 Sep, 2008 - 09:56 PM
Post #1


New D.I.C Head

*
Joined: 5 Sep, 2006
Posts: 17


My Contributions


I am building a website, I am trying to stop people from accidently (or on purpose) from registering with the same email address stored twice with capitals and without (eg J.Doe@example.com and j.doe@example.com).

If I convert all email addresses to lowercase will it cause problems because email hosters can use case sensentive email addresses- or is the practice of using cases sensitive email addresses non-existant, therefore allowing me to set all email addresses to lowercase.

Thanks in advance for any comments.
User is offlineProfile CardPM

Go to the top of the page

Martyr2
post 11 Sep, 2008 - 10:17 PM
Post #2


Programming Theoretician

Group Icon
Joined: 18 Apr, 2007
Posts: 5,062



Thanked 175 times

Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions


While the domain part of an address is not case sensitive, the local mailbox part certainly can be. However in practice it would be foolish to make it case sensitive because that would be only headaches. That is why ISPs don't typically enforce the rule and so most of the time there is no case sensitivity.

But for what you are wanting to do you don't have to worry too much. You are just wanting to make sure no two people use the same address with different case. So what you can do is store the email address just like they typed it, but when checking if the email exists or is the same, through your server-side programming language lowercase both of them only for comparison. That way you can tell if they match. BUT ONLY FOR THE COMPARISON. The actual storing of the email will be the case they typed (just in case there is that sensitive email box out there).

I hope that answered the question. smile.gif

This post has been edited by Martyr2: 11 Sep, 2008 - 10:18 PM
User is offlineProfile CardPM

Go to the top of the page

swichnz
post 11 Sep, 2008 - 10:46 PM
Post #3


New D.I.C Head

*
Joined: 5 Sep, 2006
Posts: 17


My Contributions


Hi

Yes, thank you that is very helpful and what I was looking for. smile.gif
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/23/08 05:02AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month