using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Web.Mail;
using Web.Bll;
/// <summary>
/// Send 的摘要说明
/// </summary>
public class Send
{
public static bool SendMail(string mail)
{
try
{
System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient();
client.Host = "smtp.163.com";//邮件服务器
client.UseDefaultCredentials = false;
client.Credentials = new System.Net.NetworkCredential("hu8102@163.com", "429603602");//发件人邮件地址,发件人邮箱密码
client.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage("hu8102@163.com", mail);//发件人邮箱地址,收件人邮箱
message.Subject = "生日快乐";//标题
message.Body = WishManager.Get();//内容
message.BodyEncoding = System.Text.Encoding.UTF8;
message.IsBodyHtml = true;
client.Send(message);
return true;
}
catch
{
return false;
}
}
}
- 本文标题: 实现注册或生日提醒邮箱验证 ASP.NET
- 文章分类:【.NET/Web】
- 非特殊说明,本文版权归【胡同里的砖头】个人博客 所有,转载请注明出处.
- 上一篇:GridView合并单元格 ASP.NET
- 下一篇: 查询生日既将到来的用户 SQL语句