如何在注册时制作电子邮件验证链接并将其发送到注册的电子邮件地址? [英] how to make email verification link during registration and send it to registered email address ?

查看:140
本文介绍了如何在注册时制作电子邮件验证链接并将其发送到注册的电子邮件地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在注册时制作电子邮件验证链接并将其发送到注册的电子邮件地址?只有当用户点击该链接时,他的帐户才会被激活,否则不会。

how to make email verification link during registration and send it to registered email address ? Only if user clicks on that link his accounts gets activated otherwise not.

推荐答案

尝试

实施注册验证模式 [ ^ ]

在ASP.Net中注册激活链接后发送用户确认电子邮件 [ ^ ]


好的。让我告诉你逻辑。



完成注册后,将数据保存在数据库中并有一列 isActivated Boolean )设置为0.这意味着它处于非活动状态。



现在,当你在 Users 表中插入数据,为该注册生成一个新的 UserId 。因此,使用一些加密逻辑加密 ID 并制定一个 URL ,如下所示。 。

Okay. Let me tell you the logic.

When you are done with registration, you save the data in database and have one column isActivated (Boolean) set to 0. That means it is inactive.

Now, when you insert the data in Users Table, you get one new UserId generated for that registration. So, encrypt that ID using some Encryption logic and formulate one URL like below...
String URL = "http://wwww.yourwebsite.com/useractivation.aspx?UserId= " + encryptedUserId;



发送此信息通过邮件链接到用户



在页面 useractivation.aspx ,阅读 QueryString UserId 并查询用户表格检查用户是否被激活。如果未激活,则通过将列 isActivated 设置为1来激活用户


Send this link to the User by mail.

On the page useractivation.aspx, read the QueryString UserId and query to the Users Table to check if User is activated or not. If not activated, then activate the User by setting the column isActivated to 1.


参考:

1. registration-login-email-id-verification-scenario-in-C-Sharp / [ ^ ]

2. AccessEmailConfirmation [ ^ ]
Refer:
1. registration-login-email-id-verification-scenario-in-C-Sharp/[^]
2. AccessEmailConfirmation[^]


这篇关于如何在注册时制作电子邮件验证链接并将其发送到注册的电子邮件地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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