I am not sure what this called or how to implement it so I am looking for a starting point. Basically I am looking for a solution where a server sends a unique email out (ex:vkdndk@example.com), easy enough to do. But I am wondering if a person responds to that email address, what kind of mail server setting to do I need to have vkdndk@example.com correspond to an ID in a database and have information sent back become part of a thread?
Asked
Active
Viewed 279 times
1 Answers
1
All you should need to do is issue a query like SELECT id FROM users WHERE email LIKE ?
and bind the email as a parameter. That should return your userid, so you can go forward.
However, I feel that I need to warn you that it's not a very good idea to do this. Email headers are quite easily faked. So if someone knows your email address, they can post anything they want as you by simply faking the From header. So I'd add some more protection like requiring a password or key in the email to identify it as being from the real person...

ircmaxell
- 163,128
- 34
- 264
- 314
-
Ok I mean, how does PHP know that the email is coming in so it then knows to update the database for that user? I thought the mail server and PHP were different. – Devin Dixon Feb 25 '11 at 18:29
-
OHHH, you'll need to periodically connect to the mail server and check for new messages. There are plenty of resources for that: [How to get email messages in PHP](http://stackoverflow.com/questions/114953/how-to-get-email-and-their-attachments-from-php) for one... – ircmaxell Feb 25 '11 at 18:43