Sending Email exception
-
HI, I'm trying to send an email from my web-site, and it's actually working, everything is pretty cool, but I have this kind of exception:
Send failure: System.Web.HttpException: The "SendUsing" configuration value is invalid. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80040220): The "SendUsing" configuration value is invalid. --- End of inner exception stack trace --- at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) at System.Web.Mail.SmtpMail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) --- End of inner exception stack trace --- at System.Web.Mail.SmtpMail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) at System.Web.Mail.SmtpMail.CdoSysHelper.Send(MailMessage message) at System.Web.Mail.SmtpMail.Send(MailMessage message) at Register1.CreateUserWizard1_SendingMail(Object sender, MailMessageEventArgs e) in e:\web\myeconpaper\htdocs\Register.aspx.cs:line 64
The emaiol is sent, but the result label shows me exception, WHY?
-
HI, I'm trying to send an email from my web-site, and it's actually working, everything is pretty cool, but I have this kind of exception:
Send failure: System.Web.HttpException: The "SendUsing" configuration value is invalid. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80040220): The "SendUsing" configuration value is invalid. --- End of inner exception stack trace --- at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) at System.Web.Mail.SmtpMail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) --- End of inner exception stack trace --- at System.Web.Mail.SmtpMail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) at System.Web.Mail.SmtpMail.CdoSysHelper.Send(MailMessage message) at System.Web.Mail.SmtpMail.Send(MailMessage message) at Register1.CreateUserWizard1_SendingMail(Object sender, MailMessageEventArgs e) in e:\web\myeconpaper\htdocs\Register.aspx.cs:line 64
The emaiol is sent, but the result label shows me exception, WHY?
Repost your exception, kind of hard to follow with the scroll bar.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
-
Repost your exception, kind of hard to follow with the scroll bar.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
here is the exception: Send failure: System.Web.HttpException: The "SendUsing" configuration value is invalid. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80040220): The "SendUsing" configuration value is invalid. --- End of inner exception stack trace --- at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) at System.Web.Mail.SmtpMail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) --- End of inner exception stack trace --- at System.Web.Mail.SmtpMail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) at System.Web.Mail.SmtpMail.CdoSysHelper.Send(MailMessage message) at System.Web.Mail.SmtpMail.Send(MailMessage message) at Register1.CreateUserWizard1_SendingMail(Object sender, MailMessageEventArgs e) in e:\web\myeconpaper\htdocs\Register.aspx.cs:line 64 and here is my code:
protected void CreateUserWizard1_SendingMail(object sender, MailMessageEventArgs e) { CreateUserWizard wizard = (CreateUserWizard)sender; MembershipUser user = Membership.GetUser(wizard.UserName); e.Message.Body = e.Message.Body.Replace("<%PasswordQuestion%>", CreateUserWizard1.Question); e.Message.Body = e.Message.Body.Replace("<%PasswordAnswer%>", CreateUserWizard1.Answer); e.Message.Body = e.Message.Body.Replace("<%DomainName%>", Request.ServerVariables["SERVER_NAME"]); e.Message.Body = e.Message.Body.Replace("<%VirtualDirectory%>", Request.ApplicationPath); e.Message.Body = e.Message.Body.Replace("<%UserLogsOnAs%>", user.ProviderUserKey.ToString()); string mail = e.Message.Body.ToString(); System.Web.Mail.MailMessage objEmail=new System.Web.Mail.MailMessage(); objEmail.Body=mail; objEmail.To = CreateUserWizard1.Email; try { SmtpMail.Send(objEmail); //line 64 ResultLabel.Text="Your Email has been sent sucessfully! Thank You!"; } catch (Exception exc) { Res
-
here is the exception: Send failure: System.Web.HttpException: The "SendUsing" configuration value is invalid. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80040220): The "SendUsing" configuration value is invalid. --- End of inner exception stack trace --- at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) at System.Web.Mail.SmtpMail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) --- End of inner exception stack trace --- at System.Web.Mail.SmtpMail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) at System.Web.Mail.SmtpMail.CdoSysHelper.Send(MailMessage message) at System.Web.Mail.SmtpMail.Send(MailMessage message) at Register1.CreateUserWizard1_SendingMail(Object sender, MailMessageEventArgs e) in e:\web\myeconpaper\htdocs\Register.aspx.cs:line 64 and here is my code:
protected void CreateUserWizard1_SendingMail(object sender, MailMessageEventArgs e) { CreateUserWizard wizard = (CreateUserWizard)sender; MembershipUser user = Membership.GetUser(wizard.UserName); e.Message.Body = e.Message.Body.Replace("<%PasswordQuestion%>", CreateUserWizard1.Question); e.Message.Body = e.Message.Body.Replace("<%PasswordAnswer%>", CreateUserWizard1.Answer); e.Message.Body = e.Message.Body.Replace("<%DomainName%>", Request.ServerVariables["SERVER_NAME"]); e.Message.Body = e.Message.Body.Replace("<%VirtualDirectory%>", Request.ApplicationPath); e.Message.Body = e.Message.Body.Replace("<%UserLogsOnAs%>", user.ProviderUserKey.ToString()); string mail = e.Message.Body.ToString(); System.Web.Mail.MailMessage objEmail=new System.Web.Mail.MailMessage(); objEmail.Body=mail; objEmail.To = CreateUserWizard1.Email; try { SmtpMail.Send(objEmail); //line 64 ResultLabel.Text="Your Email has been sent sucessfully! Thank You!"; } catch (Exception exc) { Res
asem0525 wrote:
"SendUsing" configuration value is invalid
What is the value of
SendUsing
?"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
-
asem0525 wrote:
"SendUsing" configuration value is invalid
What is the value of
SendUsing
?"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon