这是关于需要验证的服务器加上用户名和密码,呵呵。
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication ,mail是一个mailmessage型的变量
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", this.UserName); //set your username here
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", this.Password); //set your password here
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", this.Password); //set your password here
ADO关闭连接池:
OLE:连接字符串后加 OLE DB Services=-4
SQL: Pooling=False