通过电子邮件和电子邮件进行电子邮件验证PHP? [英] E-mail verification through e-mail & PHP?

查看:201
本文介绍了通过电子邮件和电子邮件进行电子邮件验证PHP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在某些网站上看到,用户只需将空白的电子邮件发送到类似于verify@domain.com的邮件,即可在验证电子邮件中遇到问题时验证电子邮件。我有一个PHP / MySQL的网站,我想实现这个相同的功能,但是除了发送之外,我还没有做太多的电子邮件,所以我甚至不知道从哪里开始设置这样的东西。

I have seen on some sites where the user can simply send a blank e-mail to something like verify@domain.com 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.

推荐答案

基本上,如果您的邮箱是IMAP,您可以通过PHP引用这些功能 http://www.php.net/manual/en/ref.imap.php (如果启用,请检查您的phpinfo())并阅读该特定邮箱( http:// www。 php.net/manual/en/function.imap-open.php )。
每10分钟运行一个cronjob(我说10分钟,因为我看不到很多人这样做),循环通过所有的电子邮件(如果有的话),运行你的逻辑来验证电子邮件帐户,发送他们的电子邮件说它已被验证,然后从您的帐户删除该电子邮件项目,所以您不会创建大量积压的电子邮件。

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.

这篇关于通过电子邮件和电子邮件进行电子邮件验证PHP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆