菜鸟提问关于发送需要smtp验证mail的方法

dated dated 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
各位老师近日我用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>
...全文

相关推荐

评论 6
收藏 已收藏
分享
返回顶部
dated
VB 16,718 成员 110,520 内容