135-1821-9792

vb.net邮箱激活 邮件里microsoft激活代码怎样看

asp.net 实现邮箱验证激活注册用户

我告诉你

让客户满意是我们工作的目标,不断超越客户的期望值来自于我们对这个行业的热爱。我们立志把好的技术通过有效、简单的方式提供给客户,将通过不懈努力成为客户在信息化领域值得信任、有价值的长期合作伙伴,公司提供的服务项目有:主机域名、网络空间、营销软件、网站建设、普陀网站维护、网站推广。

你需要一个字段来存储这个用户的验证号

然后再注册的时候

int checkNumber = ran.Next(10000, 99999); 生成一个随机吗 存到数据库

然后发送邮件 如下

string smtpServer = 地址

int smtpPort = 端口

string userAccount = 帐号

string userPassword = 密码

string userName = 姓名

string EmailAddress = EMAIL地址

System.Net.Mail.SmtpClient client = new SmtpClient(smtpServer, smtpPort);

client.UseDefaultCredentials = false;

client.Credentials = new System.Net.NetworkCredential(userAccount, userPassword);

client.DeliveryMethod = SmtpDeliveryMethod.Network;

MailAddress fromEmal = new MailAddress(EmailAddress, userName);

MailAddress toEmail = new MailAddress(strto);

System.Net.Mail.MailMessage message = new MailMessage(fromEmal, toEmail);

message.Subject = strSubject;

message.Body = strBody;

message.BodyEncoding = System.Text.Encoding.UTF8;

message.IsBodyHtml = true;

client.Send(message);

如何用VB.Net收发邮件

在Identity2.0里面封装了IIdentityMessageService接口,可以用来发送接收邮件。

看看

Imports System.Threading.Tasks

Imports System.Security.Claims

Imports Microsoft.AspNet.Identity

Imports Microsoft.AspNet.Identity.EntityFramework

Imports Microsoft.AspNet.Identity.Owin

Imports Microsoft.Owin

Imports Microsoft.Owin.Security

public function SendAsync(message as IdentityMessage) as task

dim credentialUserName = "邮箱登录名"

dim sentFrom = "你的邮箱地址"

dim pwd= "邮箱登录密码";

dim client as new System.Net.Mail.SmtpClient("smtp服务器地址")

client.Port = 25'mtp邮件服务器端口

client.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network

client.UseDefaultCredentials = false

dim credentials as new System.Net.NetworkCredential(credentialUserName, pwd)

client.EnableSsl = true

client.Credentials = credentials

dim mail as new System.Net.Mail.MailMessage(sentFrom, message.Destination)

mail.Subject = message.Subject

mail.Body = message.Body

return client.SendMailAsync(mail)

end function

asp.net(vb)如何实现邮箱验证激活注册用户

告诉你原理吧,要实现邮箱激活其实就是解决服务器上发邮件的问题,用户注册后,把用户状态默认成未激活,然后生成一个链接到一个页面,在那个页面加载时运行一个SQl语句把用户状态改成激活,然后再跳转到什么成功激活的页面就可以了,当然要传递一些有效的参数了;邮件激活的话就给注册时用户填写的邮箱发信就可以了,内容里面写上那个自动生成链接,怎么发邮件呢,建议你使用第三方控件Jmail不错,当然还有别的,如果用Smtp协议发的话20封左右就挂掉了···

找回密码一样,用户回答对密保问题的话就把密码给他发到邮箱就是了,归根结底还是发邮件···

补一句:源码的没有····


文章标题:vb.net邮箱激活 邮件里microsoft激活代码怎样看
文章出自:http://kswsj.com/article/ddciged.html

其他资讯



Copyright © 2009-2022 www.kswsj.com 成都快上网科技有限公司 版权所有 蜀ICP备19037934号