SmtpMail.Send(msg) problem
-
hello, here is the code am using , trying to send a mail. am sitting in a networked environment. MailMessage msg = new MailMessage(); msg.To="anazir@xavor.com.pk"; msg.From="ASIM"; msg.Body="aoa"; SmtpMail.Send(msg); this is the error on pressing button, for sending mail. 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 62: string subject = "UtilMailMessage001"; Line 63: string body = "UtilMailMessage001 - success"; Line 64: SmtpMail.Send(from, to, subject, body); Line 65: Line 66: Source File: c:\inetpub\wwwroot\mailapplication\webform1.aspx.cs Line: 64 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.CdoSysHelper.Send(String from, String to, String subject, String messageText) System.Web.Mail.SmtpMail.Send(String from, String to, String subject, String messageText) mailapplication.WebForm1.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\mailapplication\webform1.aspx.cs:64 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHand
-
hello, here is the code am using , trying to send a mail. am sitting in a networked environment. MailMessage msg = new MailMessage(); msg.To="anazir@xavor.com.pk"; msg.From="ASIM"; msg.Body="aoa"; SmtpMail.Send(msg); this is the error on pressing button, for sending mail. 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 62: string subject = "UtilMailMessage001"; Line 63: string body = "UtilMailMessage001 - success"; Line 64: SmtpMail.Send(from, to, subject, body); Line 65: Line 66: Source File: c:\inetpub\wwwroot\mailapplication\webform1.aspx.cs Line: 64 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.CdoSysHelper.Send(String from, String to, String subject, String messageText) System.Web.Mail.SmtpMail.Send(String from, String to, String subject, String messageText) mailapplication.WebForm1.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\mailapplication\webform1.aspx.cs:64 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHand