本文介绍了Web.Mail问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 当我尝试使用System.Web.Mail命名空间发送电子邮件时 我得到一个例外 无法创建CDO .message对象。 仅供参考 - 我工作了很长时间,类似的例外是 无法创建CDO.message对象。我想通过 注册CDO.dll解决了这个问题。 我正在运行VB.NET 2002,Framework 1.0(尽管我已经安装了 框架1.1 - 它仍然说我在运行IDE时运行1.0关于 框) 这是附加到按钮的代码 Dim mMail As SmtpMail ''mMail.SmtpServer =" smtp-server.kc.rr.com" mMail.SmtpServer =" localhost" ''mMail.SmtpServer =" 127.0.0.1" 尝试 mMail.Send(" [email protected]" ;,me *** @ kc.rr.com"," Test","测试主体) Catch ex As Exception MsgBox("发生以下异常:" + ex.ToString()) ''检查InnerException 而不是(ex.InnerException什么都不是) MsgBox(以下InnerException报告: ; + ex.InnerException.ToString()) ex = ex.InnerException 结束时 结束尝试 任何人都知道我的下一步 解决方案 查看< URL:http://www.systemwebmail.net/>。 - Herfried K. Wagner [MVP] < URL:http://dotnet.mvps.org/> When I try to send email using the System.Web.Mail namespace I get an exception of Could not Create CDO.message object. FYI - I worked for a long time with a similar exception of"Could not create CDO.message object". I think I resolved that byregistering CDO.dll.I am running VB.NET 2002, Framework 1.0 (Even though I have installedFramework 1.1 - it still says I am running 1.0 when I pull up the IDE aboutbox) This is the code attached to a button Dim mMail As SmtpMail ''mMail.SmtpServer = "smtp-server.kc.rr.com" mMail.SmtpServer = "localhost" ''mMail.SmtpServer = "127.0.0.1" Try mMail.Send("[email protected]", "me***@kc.rr.com", "Test", "Test body") Catch ex As Exception MsgBox("The following exception occurred: " + ex.ToString()) ''check the InnerException While Not (ex.InnerException Is Nothing) MsgBox("The following InnerException reported: " +ex.InnerException.ToString()) ex = ex.InnerException End While End TryAnybody know my next step 解决方案 Take a look at <URL:http://www.systemwebmail.net/>. --Herfried K. Wagner [MVP]<URL:http://dotnet.mvps.org/> 这篇关于Web.Mail问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-20 07:06