菜鸟提问关于发送需要smtp验证mail的方法
dated 2005-02-23 09:57:31 各位老师近日我用asp.net and vb.net编写了一个发送mail的程序,参考了下面的代码,但是还是提示:CDO.message错误,小鸟不明白mail.fields.add的http://schemas.microsoft.com/cdo/configuration/smtpauthenticate参数是什么东西,望各位达人详细解答(最好用vb.net语言解释,c#俺不懂).
<%@ Import Namespace="System.Web.Mail" %>
<script runat="server">
MailMessage mail=new MailMessage();
mail.From="service@brookes.com";
mail.To="brookes@brookes.com";
mail.BodyFormat=MailFormat.Text;
mail.Body="a test smtp mail.";
mail.Subject="hello."
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "brookes"); //set your username here
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "walkor"); //set your password here
SmtpMail.SmtpServer="lsg.moon.net";
SmtpMail.Send(mail);
</script>