Email verification function

I have a site were members can opt to receive important upgrades or new features. A lot of members choose to receive such info but then enter crap as email address. So when I send my mailings I get a lot of bounce email.

I searched Internet and found this article:

Validate an E-Mail Address with PHP, the Right Way | Linux Journal

How about the example in Listing 2? Is this a good email verification function? Are there better onces out there?

I know that such email verification function will not avoid people from entering a wrong email addresses but I prefer a valid wrong email address than an invalid wrong email address. Know what I mean? :wink:

Your scenario does not make sense to me, if it is truly an “opt in” option, why would anyone bother writing bad email addresses in the input box?

If you do flag email address as mandatory, then you will get a lot of crap entered.

If it is optional then you want your backend code to verify that it is a correctly formed email address or do what?

a) Notify the user and try again till they get it right?
b) Dump the email data and carry on with other tasks?

PHP5 onwards use PHP: Validation - Manual

Given your description you should do the backend check/dump action at b) and also put a simple JS email checker in amongst your html, so that if they do enter an email address they cannot submit the form till they at least format it correctly.

Now, if they turn JS off AND submit a badly formed email address then

c) abort the whole operation

'cause someone is messing with you…

You must provide a true email address to use our service. It’s in our terms of service. But to receive updates you must also opt in. But what people do is use crap as email and opt in. Don’t ask me why, they just do.

If it’s mandatory, implement a system to verify the address listed receives a confirmation link via that must be clicked to enable access.

If you do that, the onus is on the use to provide a valid address (if only for short period of time).

Nah, I personally hate this. When I sign up for a service I want the account to be created instantly. That is what I try to do for my services.

Well, it’s obviously up to you how you enforce your ToS, but if you absolutely need an email address for the service you’re offering to be functional, this is the way to go.

Alternatively, you could simply restrict operations until the address is confirmed.

If the user wishes to opt-in to your mailings, use the aforementioned confirmation email or disable opt-in when you receive a bounce back.

Well thats obvious then. Still create the account but send the email a day later. You can then warn the user of this during the signup process and tell them that they will have 48 hours to click the link. That way they get to use your service instantly and you get confirmation of their email address.

So in effect you are saying to your users they must provide a valid email address
and later you ask if they want to ‘opt in’ to get other news and so on.

Now its up to you what you do, as Anthony says.

This probably depends on the value you place on having a correct email address. If the email address does not even look correct do you want to :

  1. have no dealings with them
  2. accept that they want to use your service, but be prepared to be unable to identify them with an email address

If this is no more than a petty annoyance, I’d be inclined to ask twice for the email address, anyone entering crap (speaking from experience) will not remember what they just wrote.

@Cups: Although its in our Terms of Service, I don’t mind if you use crap for email address and do not opt in. Not everyone likes to give out their email address. But what annoys me are members that use crap as email address and still opt in.

@tangoforce: This is not a bad idea at all! You know of any services that implement this method? I want to see how the formulate this in proper English.

If you’re not using the email address as a login, then you could use javascript to only show the email field if they check the ‘Opt-In’ box? That way, they won’t even have the option to add an email if they aren’t opting in… Obviously, if you’re using the email for anything else, then that’s not viable…

@LSC-Rob: email address and password are used to login.

I was just thinking about this and realised that it won’t work. What happens when the members does not click on the link? Then either their account is deleted, or they are automatically opted out right? But some spamfilters flags our mails as being junkmail and put them in the junkmail folder. So this means that the members never gets to see the mail and thus cannot click on the link. So then their account gets deleted, or they are opted out while everything was ok.


Yep, I think that this is my best option. Thanks!

Not all email servers will bounce email though.

My method will still work if you think about it… You could show a flag on the users page with a message saying “Your account still needs to be verifified, if you did not receive our email click here for a new one”

Must i think of everything? :stuck_out_tongue:

Can’t help much more now as i’ve got a medical appointment shortly but i’ll try to help later with more info if needed.