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. About target invocatin exception..!!urgent..plz

About target invocatin exception..!!urgent..plz

Scheduled Pinned Locked Moved ASP.NET
helpcsharpquestion
4 Posts 3 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.
  • G Offline
    G Offline
    Gowtham Sen
    wrote on last edited by
    #1

    Hai friends, I have a requirement that, I need to send mails through .net. But while I am sending I am getting an error message "Exception was thrown by target of invocation exception. How can I resolve this. could you please help me. My code is as follows. msg = new MailMessage(); msg.To = txtMailTo.Text; // to mail address. msg.From="Mail:"; msg.Subject=txtMailSubject.Text ; // mail subject. msg.Body= txtMailBody.Text; // mail body. msg.Priority = MailPriority.Normal; msg.Headers.Add("Mail","Mail"); SmtpMail.SmtpServer=(string)ConfigurationSettings.AppSettings["SmtpServer"]; SmtpMail.Send(msg); ' Thanks and Regards. Gowtham Sen.

    M 1 Reply Last reply
    0
    • G Gowtham Sen

      Hai friends, I have a requirement that, I need to send mails through .net. But while I am sending I am getting an error message "Exception was thrown by target of invocation exception. How can I resolve this. could you please help me. My code is as follows. msg = new MailMessage(); msg.To = txtMailTo.Text; // to mail address. msg.From="Mail:"; msg.Subject=txtMailSubject.Text ; // mail subject. msg.Body= txtMailBody.Text; // mail body. msg.Priority = MailPriority.Normal; msg.Headers.Add("Mail","Mail"); SmtpMail.SmtpServer=(string)ConfigurationSettings.AppSettings["SmtpServer"]; SmtpMail.Send(msg); ' Thanks and Regards. Gowtham Sen.

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      Hi there, You may want to troubleshoot your issue with the help of the site http://www.systemwebmail.com[^]

      G 1 Reply Last reply
      0
      • M minhpc_bk

        Hi there, You may want to troubleshoot your issue with the help of the site http://www.systemwebmail.com[^]

        G Offline
        G Offline
        Gowtham Sen
        wrote on last edited by
        #3

        Hi, Thanks a lot. But I have already visited that site. But I didn't find any solution. Could you please give me some other idea. Thanks and Regards Gowtham sen.

        N 1 Reply Last reply
        0
        • G Gowtham Sen

          Hi, Thanks a lot. But I have already visited that site. But I didn't find any solution. Could you please give me some other idea. Thanks and Regards Gowtham sen.

          N Offline
          N Offline
          nidheeshkayal
          wrote on last edited by
          #4

          using system.net.mail; MailMessage mmsg = new MailMessage(); mmsg.From= new MailAddress("from address"); mmsg.To.Add("to address"); mmsg.Subject = "simple email"; mmsg.Body = "this is the message body"; SmtpClient smtp1 = new SmtpClient("sever name"); try { smtp1.Send(mmsg); }catch(Exception ex){} try above 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