开发者

Email To Database relationship

I am not sure what this called or how to implement it 开发者_StackOverflow中文版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?


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...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜