Send a Mail via Exchange Server
-
Hi! I want to send a mail via a Microsoft Exchange Server. Does anybody know how I can realize it? regards spotl
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.
-
Hi! I want to send a mail via a Microsoft Exchange Server. Does anybody know how I can realize it? regards spotl
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); }
-
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); }