views:

55

answers:

2

I have seen on some sites where the user can simply send a blank e-mail to something like [email protected] to have their e-mail verified if they are having trouble getting the verification e-mail. I have a website with PHP/MySQL that I'd like to implement this same functionality, but I haven't done much with e-mail besides sending it so I don't even know where to start to set something like this up.

+2  A: 

Basically if your mailbox is an IMAP you could reference these functions via PHP http://www.php.net/manual/en/ref.imap.php (if enabled, check your phpinfo()) and read that specific mailbox (http://www.php.net/manual/en/function.imap-open.php). Run a cronjob every 10 minutes maybe (I say 10minutes as I dont see many people doing this), loop thru all the emails (if any), run your logic to verify that email account, send them an email to say its been verified, then delete that email item from your account so you are not creating a massive backlog of emails.

Its risky way of wanting someone to verify but this is probably one way of doing it.

PHPology
A: 

If your host allows you to, you can pipe received email to a program (in your case, a PHP script), which could then parse the message and decide what to do.

However, I agree that this isn't very secure. It would be very easy to spoof the sender, unless you implement DomainKey checking or DNS lookups.

TheDeadMedic