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. Send a Mail via Exchange Server

Send a Mail via Exchange Server

Scheduled Pinned Locked Moved C#
sysadminquestion
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.
  • S Offline
    S Offline
    spotl
    wrote on last edited by
    #1

    Hi! I want to send a mail via a Microsoft Exchange Server. Does anybody know how I can realize it? regards spotl

    C R 2 Replies Last reply
    0
    • S spotl

      Hi! I want to send a mail via a Microsoft Exchange Server. Does anybody know how I can realize it? regards spotl

      C Offline
      C Offline
      Corinna John
      wrote on last edited by
      #2

      There are several interfaes you can use to connect to an Exchange server: - WebDAV - Outlook automation - MAPI / CDO 1.21 - CDOEx / ADO - the .NET-Classes in System.Web.Mail WebDAV is easy to implement and seems to be very reliable. You can find a lot of example code with the Google newsgroups search. Outlook or MAPI require Outlook to be installed and configured on every local machine. CDOEx works only on the machine that runs an Exchange server and hosts the mailbox profile you want to use. System.Web.Mail requires a cdosys.dll which is usually (but not always) installed together wich Outlook. I recommend you get some sample code for WebDAV. System.Web.Mail or Outlook automation may be easier to implement, but they depend on additional client software on the local machine. WebDAV uses only HTTP, so it will work on every machine.

      ____________________________________ There is no proof for this sentence.

      1 Reply Last reply
      0
      • S spotl

        Hi! I want to send a mail via a Microsoft Exchange Server. Does anybody know how I can realize it? regards spotl

        R Offline
        R Offline
        Rakheesh Chalil
        wrote on last edited by
        #3

        Hi, Using System.Net.Mail class in .NET 2.0\ using System.Net.Mail; { string mailFrom = "abc@cdf.com"//From address goes here string mailTo = "xyz@klm.com"//To address goed here MailMessage mailMessage = new MailMessage(mailFrom, mailTo); mailMessage.Subject = "Test";//Your mail Subject goes here mailMessage.Body = "This is just a test";//Your mail body goes here mailMessage.Priority = MailPriority.Normal; string server = "SMTPServer Name goes here"; SmtpClient client = new SmtpClient(server); //Send the email client.Send(mailMessage); }

        S 1 Reply Last reply
        0
        • R Rakheesh Chalil

          Hi, Using System.Net.Mail class in .NET 2.0\ using System.Net.Mail; { string mailFrom = "abc@cdf.com"//From address goes here string mailTo = "xyz@klm.com"//To address goed here MailMessage mailMessage = new MailMessage(mailFrom, mailTo); mailMessage.Subject = "Test";//Your mail Subject goes here mailMessage.Body = "This is just a test";//Your mail body goes here mailMessage.Priority = MailPriority.Normal; string server = "SMTPServer Name goes here"; SmtpClient client = new SmtpClient(server); //Send the email client.Send(mailMessage); }

          S Offline
          S Offline
          spotl
          wrote on last edited by
          #4

          Thank you for your help, but I want to send a mail via Exchange Server and not via Smtp Server. Sending a mail via Smtp does already work :-) regards spotl

          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