电子邮件地址验证方法(订阅按钮) [英] Email address validation methods (Subscribe button)

查看:225
本文介绍了电子邮件地址验证方法(订阅按钮)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在php编码一个网站,我目前正在联系我们的页面,我想知道验证电子邮件地址的最佳方法是什么?


  1. 通过发送验证链接到他们的电子邮件?

  2. 正则表达式

  3. 任何其他方法?

还可以告诉我为什么和指导我的方式实现吗?我不想有人为我做代码,因为这对我来说没有什么乐趣,我不会学习,只是一些关于用于实现上述方法的指导。



另外我将使用这些方法在我的网页上实现一个订阅按钮。这是最好的办法吗?我应该放弃任何其他方法?

解决方案

我通常会执行这些步骤




  • 正则表达式

  • 向邮件发送激活码

  • 如果第一步失败,它不会达到第二步。
    如果电子邮件发送失败,因为电子邮件不存在我删除帐户或做一些其他的东西



    - 编辑



    3 - 如果由于某些原因激活电子邮件不被发送,电子邮件不会被删除,它保持不被批准7天(或由您配置),电子邮件重新发送在每个2-3小时后,如果没有成功,电子邮件将被删除



    4 - 如果电子邮件发送成功但未激活,则它保持未经批准,但可以随时通过生成新的激活码


    I am coding a site in php and I am currently on the contact us page and I was wondering what was the best way to validate an email address?

    1. By sending a validation link to their email?
    2. Regex
    3. Any other method?

    Also could you tell me why and a guide along my way to achieving it? I dont want someone to do the code for me because thats no fun for me and I won't learn but just some guidance on the techniques used to achieve either the methods above.

    Also I am going to use these methods to implement a subscribe button on my webpage. Is this the best way to do this? any other methods I should condsider?

    解决方案

    I usually go through these steps

    1. Regex
    2. Send an activation code to the email

    if the first step fails it never reaches second step. if the email sending fails because the email doesn't exist I delete the account or do some other stuff

    --edit

    3 - If for some reason the activation email doesn't get sent, email doesn't get deleted, it stays unapproved for 7 days (or as configured by you), email resending is tried in every 2-3 hours, after those days if no success, email is deleted

    4 - If email sent successfully but not activated it stays unapproved but can be reactivated anytime by generating a new activation code

    这篇关于电子邮件地址验证方法(订阅按钮)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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