关于ASP.NET中EMAIL发送的问题!急!在线等待!

RxitRose 2003-04-17 11:16:15
请高手帮我 一下问什么会有这个问题,如何解决
这是一个类
using System;
using System.Web.Mail;

namespace WebA
{
/// <summary>
/// Mailsend 的摘要说明。
/// </summary>
public class Email
{
private MailMessage newMail;
public Email(string txtTo,string txtMessage)
{
newMail=new MailMessage();
newMail.From="TianHeng@TianHeng.com";
newMail.To=txtTo;
newMail.Subject="天恒购书网站密码取回信!";
newMail.Body=txtMessage;
newMail.BodyFormat=System.Web.Mail.MailFormat.Html;
}
public void SendEmail()
{
SmtpMail.Send(newMail);
}



}
}
----------------------------------------------------------------------
这是发送
private void Button2_Click(object sender, System.EventArgs e)
{
Email my=new Email(TextBox2.Text,TextBox3.Text);
my.SendEmail();
}
-------------------------------------------------
下面是出现的问题
Server Error in '/WebA' Application.
--------------------------------------------------------------------------------

“SendUsing”配置值无效。
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: “SendUsing”配置值无效。

Source Error:


Line 21: public void SendEmail()
Line 22: {
Line 23: SmtpMail.Send(newMail);
Line 24: }
Line 25:


Source File: c:\inetpub\wwwroot\weba\mailsend.cs Line: 23

Stack Trace:


[COMException (0x80040220): “SendUsing”配置值无效。
]

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) +0
System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters) +473
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) +58

[HttpException (0x80004005): Could not access 'CDO.Message' object.]
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) +111
System.Web.Mail.CdoSysHelper.Send(MailMessage message) +1516
System.Web.Mail.SmtpMail.Send(MailMessage message) +49
WebA.Email.SendEmail() in c:\inetpub\wwwroot\weba\mailsend.cs:23
WebA.mytest.Button2_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\weba\mytest.aspx.cs:56
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1263


...全文
35 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
happyangelclc 2003-04-17
  • 打赏
  • 举报
回复
sendusing 是指smtp 服务器设置吗?
RxitRose 2003-04-17
  • 打赏
  • 举报
回复
没有人回答吗?
各位帮帮我了!

62,041

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

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