因为微软提供的发送邮件类需要你有邮件服务器,所以只有用JMAIL类库
jmail.MessageClass ms = new jmail.MessageClass();
ms.Charset = "gb2312";
ms.ContentType = "text/html";
ms.ISOEncodeHeaders = false;
ms.Priority = Convert.ToByte(1);
ms.From = " 76361490@qq.com";
ms.FromName = "Lee";
ms.Subject = "瑞润测试信息";
ms.MailServerUserName = "邮箱的用户名";
ms.MailServerPassWord = "邮箱的密码";
ms.AddRecipient(" zhouxing_24@yahoo.com.cn", "", "");
ms.Body = "发送一个微笑!!:)";
if (ms.Send("smtp.qq.com", false))
{
Label1.Text = "发送成功!";
}
else
{
Label1.Text = "发送失败!!请重试!";
}
ms.Charset = "gb2312";
ms.ContentType = "text/html";
ms.ISOEncodeHeaders = false;
ms.Priority = Convert.ToByte(1);
ms.From = " 76361490@qq.com";
ms.FromName = "Lee";
ms.Subject = "瑞润测试信息";
ms.MailServerUserName = "邮箱的用户名";
ms.MailServerPassWord = "邮箱的密码";
ms.AddRecipient(" zhouxing_24@yahoo.com.cn", "", "");
ms.Body = "发送一个微笑!!:)";
if (ms.Send("smtp.qq.com", false))
{
Label1.Text = "发送成功!";
}
else
{
Label1.Text = "发送失败!!请重试!";
}