用 MailMessage 发邮件(System.Web.Mail,针对.NET 1.1而说),举例代码如下:MailMessage mailMsg = new MailMessage();
mailMsg.To = "[email protected]";
mailMsg.From = "[email protected]";
mailMsg.Subject = "邮件主题";
mailMsg.Body = "邮件内容";
mailMsg.BodyFormat = MailFormat.Html;
mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "SendUserName");
mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "SendPassword");
mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", SmtpServerPort);
mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusessl", "1");
SmtpMail.SmtpServer = "SmtpSendServer";
SmtpMail.Send(mailMsg);我的问题是:1、mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", SmtpServerPort) 中,SmtpServerPort 的数据类型标准的应该是什么?我试过整型和字符串型都可以。2、mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1") 中,其值除了 "1" 是否还有 "0" ,此外是否还可以用 true/false 表示?标准的应该是什么?如果需要验证的话我试过 1/"1"/true 都可以。对于 mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusessl", "1") 亦是同样的问题。3、"http://schemas.microsoft.com/cdo/configuration/sendusername" 等键值为什么是一个 URL?其真正的意义是什么?为什么不可以直接用 "sendusername" 等来表示?除了上面列举的之外,还有哪些?希望高人可以给予解答一下,十分感谢!