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. General Programming
  3. C#
  4. Easy way to send an email from C# windows application

Easy way to send an email from C# windows application

Scheduled Pinned Locked Moved C#
csharphelptutorial
3 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.
  • M Offline
    M Offline
    Matt Fishbeck
    wrote on last edited by
    #1

    Hello All. I was wondering if anybody new the framework or some example code to send an email from a windows application. This can be done via launching a window which will have an 'automatic' attachment to be sent as an issues report. This could also be done transparenently, i.e. Without launching the outlook window...Probably allot more complicated. Any help would be appreciated. Cheers

    M G 2 Replies Last reply
    0
    • M Matt Fishbeck

      Hello All. I was wondering if anybody new the framework or some example code to send an email from a windows application. This can be done via launching a window which will have an 'automatic' attachment to be sent as an issues report. This could also be done transparenently, i.e. Without launching the outlook window...Probably allot more complicated. Any help would be appreciated. Cheers

      M Offline
      M Offline
      Manas Bhardwaj
      wrote on last edited by
      #2

      Like This[^]

      Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

      1 Reply Last reply
      0
      • M Matt Fishbeck

        Hello All. I was wondering if anybody new the framework or some example code to send an email from a windows application. This can be done via launching a window which will have an 'automatic' attachment to be sent as an issues report. This could also be done transparenently, i.e. Without launching the outlook window...Probably allot more complicated. Any help would be appreciated. Cheers

        G Offline
        G Offline
        g_amol
        wrote on last edited by
        #3

        just look www.codeproject.com/KB/cs/Sending_Mails_From_C_.aspx or First find the System.Web.dll in your computer drive where .NET Framework installed Then add a reference to that dll in your C# windows application. then write following code to send email.... string smtpServer; smtpServer= "127.0.0.1"; System.Web.Mail.MailMessage msg = new System.Web.Mail.MailMessage(); msg.From = "From Email Address"; msg.To = "To Email Address"; msg.Body = "Body here"; System.Web.Mail.MailAttachment attachFile = new System.Web.Mail.MailAttachment("Filepath"); System.Web.Mail.SmtpMail.SmtpServer = smtpServer; System.Web.Mail.SmtpMail.Send(msg); or First find the System.Web.dll in your computer drive where .NET Framework installed Then add a reference to that dll in your C# windows application. then write following code to send email.... string smtpServer; smtpServer= "127.0.0.1"; System.Web.Mail.MailMessage msg = new System.Web.Mail.MailMessage(); msg.From = "From Email Address"; msg.To = "To Email Address"; msg.Body = "Body here"; System.Web.Mail.MailAttachment attachFile = new System.Web.Mail.MailAttachment("Filepath"); System.Web.Mail.SmtpMail.SmtpServer = smtpServer; System.Web.Mail.SmtpMail.Send(msg);

        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