Sets the drafts folder name used in Exchange WebDAV protocol.
[Visual Basic] Public Property Drafts As String
[C#] public string Drafts {get; set;}
[C++] public: __property String^ get_Drafts(); public: __property void set_Drafts(String^);
[JScript] public function get Drafts() : String; public function set Drafts(String);
Property Value
Remarks
Standard SMTP protocol based on TCP/IP, all email servers support this protocol, Exchange Server also supports SMTP protocol. Using SMTP protocol is always recommended.
Exchange WebDAV is a set of methods based on the HTTP protocol to manage users, messages in Microsoft Exchange Server. We can use HTTP or HTTP/HTTPS protocol to send email with Exchange WebDAV instead of SMTP protocol. But since Exchange 2007, WebDAV service is disabled by default, so we only suggest that you use WebDAV protocol in Exchange 2000/2003.
Exchange Web Services (EWS), an alternative to the MAPI protocol, is a documented SOAP based protocol introduced with Exchange Server 2007. We can use HTTP or HTTPS protocol to send email with Exchange Web Services (EWS) instead of SMTP protocol. We only suggest that you use EWS protocol in Exchange 2007/2010 or later version.
Example
[Visual Basic, C#, C++] To get the full samples of EASendMail, please refer to Samples section.
[Visual Basic - Send Email with Exchange WebDAV] Imports EASendMail Sub SendMail_Exchange_WebDav() Try Dim oMail As New SmtpMail("TryIt") ' Set sender email address, please change it to yours oMail.From = "test@emailarchitect.net" ' Set recipient email address, please change it to yours oMail.To = "support@emailarchitect.net" ' Set email subject oMail.Subject = "test email from VB.NET project" ' Set email body oMail.TextBody = "this is a test email sent from VB.NET project, do not reply" ' Your Exchange server address Dim oServer As New SmtpServer("exch.emailarchitect.net") ' Set Exchange WebDav protocol - Exchange 2000/2003 oServer.Protocol = ServerProtocol.ExchangeWebDav ' If Exchange WebDav requires SSL connection, please add this line ' oServer.ConnectType = SmtpConnectType.ConnectSSLAuto ' Use administrator to do Exchange User authentication oServer.User = "administrator" oServer.Password = "administratorpassword" ' Use test user mail folder to send email oServer.Alias = "test" ' Set your Drafts folder name oServer.Drafts = "drafts" Console.WriteLine("start to send email ...") Dim oSmtp As New SmtpClient() oSmtp.SendMail(oServer, oMail) Console.WriteLine("This email has been submitted to server successfully!") Catch ep As Exception Console.WriteLine("failed to send email: {0}", ep.Message) End Try End Sub
[C# - Send Email using Exchange WebDAV] using System; using EASendMail; void SendMail_Exchange_WebDAV() { try { SmtpMail oMail = new SmtpMail("TryIt"); // Set sender email address, please change it to yours oMail.From = "test@emailarchitect.net"; // Set recipient email address, please change it to yours oMail.To = "support@emailarchitect.net"; // Set email subject oMail.Subject = "test email from c# project"; // Set email body oMail.TextBody = "this is a test email sent from c# project, do not reply"; // Your Exchange server address SmtpServer oServer = new SmtpServer("exch.emailarchitect.net"); // Set Exchange WebDav protocol - Exchange 2000/2003 oServer.Protocol = ServerProtocol.ExchangeWebDav; // If your Exchange WebDav requires SSL connection, please add this line // oServer.ConnectType = SmtpConnectType.ConnectSSLAuto; // Use administrator to do Exchange authentication oServer.User = "administrator"; oServer.Password = "administrator password"; // Use test user mail folder to send email oServer.Alias = "test"; // Set your Drafts folder name oServer.Drafts = "drafts"; Console.WriteLine("start to send email ..."); SmtpClient oSmtp = new SmtpClient(); oSmtp.SendMail(oServer, oMail); Console.WriteLine("This email has been submitted to server successfully!"); } catch (Exception ep) { Console.WriteLine("failed to send email: {0}", ep.Message); } }
[C++ - Send Email using Exchange WebDAV] using namespace System; using namespace EASendMail; void SendMail_Exchange_WebDav() { try { SmtpMail ^oMail = gcnew SmtpMail("TryIt"); // Set sender email address, please change it to yours oMail->From = "test@emailarchitect.net"; // Set recipient email address, please change it to yours oMail->To = "support@emailarchitect.net"; // Set email subject oMail->Subject = "test email from Managed C++ project"; // Set email body oMail->TextBody = "this is a test email sent from Managed C++ project, do not reply"; // Your Exchange server address SmtpServer ^oServer = gcnew SmtpServer("exch.emailarchitect.net"); // Set Exchange WebDav Protocol - Exchange 2000/2003 oServer->Protocol = ServerProtocol::ExchangeWebDav; // If your WebDav service requires SSL connection, please add this line // oServer->ConnectType = SmtpConnectType::ConnectSSLAuto; // Use administrator user to do Exchange WebDav authentication oServer->User = "administrator"; oServer->Password = "administrator password"; // Use test user mail folder to send email oServer->Alias = "test"; // Set your Drafts folder name oServer->Drafts = "drafts"; Console::WriteLine("start to send email from Managed C++..."); SmtpClient ^oSmtp = gcnew SmtpClient(); oSmtp->SendMail(oServer, oMail); Console::WriteLine("This email has been submitted to server successfully!"); } catch (Exception ^ep) { Console::WriteLine("failed to send email: {0}", ep->Message); } }
See Also
SmtpServer.Protocol Property
SmtpServer.Drafts Property
User Authentication and SSL Connection
Process Bounced Email (Non-Delivery Report) and Email Tracking
Online Tutorial
Send Email using Exchange WebDAV in C#
Send Email using Exchange WebDAV in VB
Send Email using Exchange Web Service in C#
Send Email using Exchange Web Service in VB