Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Sending Email exception

Sending Email exception

Scheduled Pinned Locked Moved ASP.NET
data-structuresdebuggingquestionworkspace
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hurrem
    wrote on last edited by
    #1

    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?

    P 1 Reply Last reply
    0
    • H hurrem

      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?

      P Offline
      P Offline
      Paul Conrad
      wrote on last edited by
      #2

      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

      H 1 Reply Last reply
      0
      • P Paul Conrad

        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

        H Offline
        H Offline
        hurrem
        wrote on last edited by
        #3

        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

        P 1 Reply Last reply
        0
        • H hurrem

          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

          P Offline
          P Offline
          Paul Conrad
          wrote on last edited by
          #4

          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

          H 1 Reply Last reply
          0
          • P Paul Conrad

            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

            H Offline
            H Offline
            hurrem
            wrote on last edited by
            #5

            I don't have it in my entire code.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups