asp.net中简单的邮件发送,供取回密码!
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.Net.Mail;
using System.Net.Mime;
using System.Net.Configuration;
namespace BCore.PubFunction
{
public class MailHandler
{
public bool passwordToEmail(string usermail, string newpassword, string loginname)
{
try
{
System.Configuration.Configuration config = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~/");
MailSettingsSectionGroup settings = (MailSettingsSectionGroup)config.GetSectionGroup("system.net/mailSettings");
System.Net.NetworkCredential credential = new System.Net.NetworkCredential(settings.Smtp.Network.UserName, settings.Smtp.Network.Password);
System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage();
//msg.To.Add("itblackhole@163.com");//可以发送多人
msg.To.Add(usermail);
msg.from = new MailAddress("itblackhole@gmail.com", "*******", System.Text.Encoding.UTF8); /*3个参数分别是发件人地址(可以随便写),发件人姓名,编码*/
 
相关文档:
ASP.NET vs. PHP,哪个更快?
http://www.infoq.com/cn/news/2009/09/aspnet-php-benchmark
作者 赵劼 发布于 2009年9月15日 上午5时33分
社区 .NET 主题 性能和可伸缩性 标签 PHP, ASP.NET
结论:
我们可以这么认为,对于纯粹的PHP执行性能来说,Linux和Windows相差 ......
//部署桌面快捷方式*******************#region//部署桌面快捷方式*******************
StreamWriter sw2=System.IO.File.CreateText(Context.Parameters["des"].ToString()+"WebSetupTest.url");
stateSaver.Add("DeskQuick",Context.Parameters["des"].ToString() ......
http://ayic1.blog.163.com/blog/static/27343030200965103528805/
静态变量
当我们编写一个类时,其实就是在描述其对象的属性和行为,而并没有产生实质上的对象,只有通过new关键字才会产生出对象,这时系统才会分配内存空间给对象,其方法才可以供外部调用。
& ......
ASP.NET编程的十大技巧
发布日期:2008-08-03
1、在使用Visual Studio .NET时,除直接或非引用的对象外,不要使用缺省的名字
.NET带来的好处之一是所有的源代码和配置文件都是纯文本文件,能够使用Notepad或WordPad等任意的文本编辑器进行编辑。如果不愿 意,我们并非一定要使用Visual Studio .NET作为集成开发环境。 ......
内容页访问MasterPage中的控件,有两种解决方案:
一、是用弱类型访问
使用 FindControl 方法获取模板页的控件
((Label)Master.FindControl("Label1")).Text = "xxx";
二、给模板页添加属性来使用强类型访问(推荐)
模板页定义;
&nb ......