我遇到了最奇怪的问题。我有一个 VS2003 应用程序,它允许用户向多个来源发送邮件。该应用程序有效,但似乎我的应用程序中的邮件仅在某些时候发送。在测试环境中,每次都会发送邮件,但在生产环境中有时会失败,但当用户稍后尝试发送邮件时,他们会成功。谁能提出一个原因,我怀疑这可能是我的服务器设置有问题,但我不知道那可能是什么。产生的错误如下。
Server Error in '/PurchasingDept/rfqapp4' Application.
At least one recipient is required, but none were found.
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: At least one recipient is required, but none were found.
Source Error:
Line 248: ucDlgBox.ShowError("Mail failed!",
Line 249: "The Rfq mail has not been sent.<br>" +
Line 250: "Please contact the <a href='mailto:webmaster@guysuco.com'>" +
Line 251: "webmaster</a> referring to quote number " + gstrRFQNo + ".");
Line 252: }
Source File: \\webtest\sites\intranet\purchasingdept\rfqapp4\managerfq\view.aspx.cs Line: 250
Stack Trace:
[COMException (0x8004020c): At least one recipient is required, but none were found.
]
[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) +468
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) +112
System.Web.Mail.CdoSysHelper.Send(MailMessage message) +1565
System.Web.Mail.SmtpMail.Send(MailMessage message) +150
Guysuco.RFQApp.Upgrade.MailRFQ.MailRFQToVendors2(String strFile, DataTable dtVendors) in e:\projects\guysuco.rfqapp.upgrade\mailrfq.cs:94
Guysuco.RFQApp.Upgrade.MailRFQ.MailRFQ2(String RfqNoticeFile, String username, DateTime timeStamp) in e:\projects\guysuco.rfqapp.upgrade\mailrfq.cs:45
Guysuco.RfqApp.managerfq.view.btnSend_Click(Object sender, EventArgs e) in \\webtest\sites\intranet\purchasingdept\rfqapp4\managerfq\view.aspx.cs:250
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() +1292