SmtpServer.Drafts Property


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

A string value indicating the drafts name for Exchange WebDAV.

Remarks

If you choose Exchange WebDAV protocol, you need to input your "Drafts" mail folder name here. Default name is "Drafts", but if your default language is not English in Exchange Server, your drafts name will be another name in your language. For example, if your default language is Chinese, your drafts name is "草稿", then you should input your drafts name here.
For SMTP and Exchange Web Service protocol, you can simply ignore this property.

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