Unable To send Mail using System.Web.Mail Namespace

Unable To send Mail using System.Web.Mail Namespace

Post by shailesh sha » Fri, 07 Mar 2003 21:12:23



// Create the message.
MailMessage cmsMail = new MailMessage();
// Set the message properties.


cmsMail.Subject = password;
// Param's  are parameter object.

+ ",\n\nYour new Password is "+ parms[1].Value.ToString()
+ " for Appreciative Interviews.\n\nThanks";
cmsMail.To = parms[2].Value.ToString); // mail address

Error:

Server Error in '/Change' Application.
----------------------------------------------------------
----------------------

The "SendUsing" configuration value is invalid.
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:
The "SendUsing" configuration value is invalid.

Source Error:

Line 94:                        */
Line 95:                        // Send the message.
Line 96:                        SmtpMail.Send(cmsMail);
Line 97:
Line 98:                        lblLoginErrMsg.Text =
Constants.MAIL_MESSAGE_SENT;

Source File: d:\change\signin.aspx.cs    Line: 96

Stack Trace:

[COMException (0x80040220): The "SendUsing" configuration
value is invalid.
]

[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.Type.InvokeMember(String name, BindingFlags
invokeAttr, Binder binder, Object target, Object[] args)
+29
   System.Web.Mail.LateBoundAccessHelper.CallMethod(Type
type, Object obj, String methodName, Object[] args)
   System.Web.Mail.LateBoundAccessHelper.CallMethod
(Object obj, String methodName, Object[] args)

[HttpException (0x80004005): Could not
access 'CDO.Message' object.]
   System.Web.Mail.LateBoundAccessHelper.CallMethod
(Object obj, String methodName, Object[] args)
   System.Web.Mail.CdoSysHelper.Send(MailMessage message)
   System.Web.Mail.SmtpMail.Send(MailMessage message)
   change.SignIn.ForgotPassword(Object sender, EventArgs
e) in d:\change\signin.aspx.cs:96
   System.Web.UI.WebControls.LinkButton.OnClick(EventArgs
e)

System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBa
ckEventHandler.RaisePostBackEvent(String eventArgument)
   System.Web.UI.Page.RaisePostBackEvent
(IPostBackEventHandler sourceControl, String
eventArgument)
   System.Web.UI.Page.RaisePostBackEvent
(NameValueCollection postData)
   System.Web.UI.Page.ProcessRequestMain()

----------------------------------------------------------
----------------------
Version Information: Microsoft .NET Framework
Version:1.0.3705.0; ASP.NET Version:1.0.3705.0