Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- php and email authentivation
September 6, 2006, 7:13 am
rate this thread
i need a framework to set up a web service with email authentication:
that is, I need the user to insert his/her email, I send him/her a code
via email and when the confirm email arrives, the user is confirmed:
it is done in various web services, nothing new :-(
But how can I do it? I have seen various CMS which get the
but not the mail confirmation: I obviously need to intercept incoming
to check, but how is it done in php?
Re: php and email authentivation
It depends on your MTA. If your agent allows it, you could pipe the
incoming message to a batch file and parse the incoming mail. If not,
you can run a cron job every few minutes to check the mail queue and get
In the latter case it depends if you're using IMAP or POP3 mail. You
can look up the necessary commands in the RFC's.
For instance, for POP3 you would want to open a socket to the mail
server's port 110, issue the USER and PASS commands. Then you can LIST
the mail in the box and RETR them one by one. When done with a message,
you can DELE it. When you've completed processing of the mailbox you
You can also execute these commands from a telnet session to see what
the responses look like.
Remove the "x" from my email address
JDS Computer Training Corp.