菜鸟提问关于发送需要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>
...全文
104 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
dated 2005-03-14
  • 打赏
  • 举报
回复
再试试
3tzjq 2005-02-24
  • 打赏
  • 举报
回复
也算是微软提供的一种Smtp服务的驱动吧!
dated 2005-02-24
  • 打赏
  • 举报
回复
可是这条网址是什么意思http://schemas.microsoft.com/cdo/configuration/smtpauthenticate
dated 2005-02-24
  • 打赏
  • 举报
回复
如果这样可还是提示cdo.message错误啊,我电脑是代理服务器,但在程序中已经做了处理啊
3tzjq 2005-02-23
  • 打赏
  • 举报
回复
'表示发送服务器需要身份验证
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");

'表示帐户名
("http://schemas.microsoft.com/cdo/configuration/sendusername", "brookes");

'表示登录密码
("http://schemas.microsoft.com/cdo/configuration/sendpassword", "walkor");
yangzaru 2005-02-23
  • 打赏
  • 举报
回复
邮箱验证方式。。。。。前面有很多这种贴子。。。自己动手找找看。。。

16,554

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧