Protocol Property


This property indicates the server protocol (SMTP/Exchange Web Service/Exchange WebDAV).

Data Type: Long

Value Meaning
0 (Default) Standard SMTP Protocol
1 Exchange Web Service - EWS - Exchange Server 2007/2010/2013
2 Exchange Web DAV - Exchange Server 2000/2003

Remarks

Example

[Visual Basic] To get the full samples of EASendMail, please refer to Samples section.

[VB6, VBA - Send Email with Stanard SMTP Protocol]
Private Sub Send_Email_SMTP()
    
    Dim oSmtp As New EASendMailObjLib.Mail
    oSmtp.LicenseCode = "TryIt"
    
    ' Set your sender email address
    oSmtp.FromAddr = "test@emailarchitect.net"

    ' Add recipient email address
    oSmtp.AddRecipientEx "support@emailarchitect.net", 0
    
    ' Set email subject
    oSmtp.Subject = "simple email from VB 6.0 project"
    
    ' Set email body
    oSmtp.BodyText = "this is a test email sent from VB 6.0 project, do not reply"
    
    ' Your SMTP server address
    oSmtp.ServerAddr = "smtp.emailarchitect.net"
    
    ' User and password for ESMTP authentication, if your server doesn't require
    ' User authentication, please remove the following codes.
    oSmtp.UserName = "test@emailarchitect.net"
    oSmtp.Password = "testpassword"

    ' If your smtp server requires SSL connection, please add this line
    ' oSmtp.SSL_init
    
    MsgBox "start to send email ..."

    If oSmtp.SendMail() = 0 Then
        MsgBox "email was sent successfully!"
    Else
        MsgBox "failed to send email with the following error:" & oSmtp.GetLastErrDescription()
    End If
    
End Sub

[VB6, VBA - Send Email with Exchange Web Service - EWS]
Private Sub Send_Email_Exchange_EWS()
    
    Dim oSmtp As New EASendMailObjLib.Mail
    oSmtp.LicenseCode = "TryIt"
    
    ' Set your sender email address
    oSmtp.FromAddr = "test@emailarchitect.net"

    ' Add recipient email address
    oSmtp.AddRecipientEx "support@emailarchitect.net", 0
    
    ' Set email subject
    oSmtp.Subject = "simple email from VB 6.0 project"
    
    ' Set email body
    oSmtp.BodyText = "this is a test email sent from VB 6.0 project, do not reply"
    
    ' Your Exchange server address
    oSmtp.ServerAddr = "exch.emailarchitect.net"
    
    ' Set Exchange Web Service Protocol - EWS - Exchange 2007/2010
    oSmtp.Protocol = 1

    ' User and password for Exchange Web Service authentication
    oSmtp.UserName = "test"
    oSmtp.Password = "testpassword"

    ' By default, Exchange Web Service requires SSL connection.
    oSmtp.SSL_init
    
    MsgBox "start to send email ..."

    If oSmtp.SendMail() = 0 Then
        MsgBox "email was sent successfully!"
    Else
        MsgBox "failed to send email with the following error:" & oSmtp.GetLastErrDescription()
    End If
    
End Sub

[VB6, VBA - Send Email with Exchange WebDAV]
Private Sub Send_Email_Exchange_WebDav()
    
    Dim oSmtp As New EASendMailObjLib.Mail
    oSmtp.LicenseCode = "TryIt"
    
    ' Set your sender email address
    oSmtp.FromAddr = "test@emailarchitect.net"

    ' Add recipient email address
    oSmtp.AddRecipientEx "support@emailarchitect.net", 0
    
    ' Set email subject
    oSmtp.Subject = "simple email from VB 6.0 project"
    
    ' Set email body
    oSmtp.BodyText = "this is a test email sent from VB 6.0 project, do not reply"
    
    ' Your Exchange server address
    oSmtp.ServerAddr = "exch.emailarchitect.net"
    
    ' Set Exchange WebDav Protocol - Exchange 2000/2003
    oSmtp.Protocol = 2

    ' User and password for Exchange WebDav authentication
    oSmtp.UserName = "test"
    oSmtp.Password = "testpassword"

    ' If your WebDav requires SSL connection, please add this line
    ' oSmtp.SSL_init
    
    MsgBox "start to send email ..."

    If oSmtp.SendMail() = 0 Then
        MsgBox "email was sent successfully!"
    Else
        MsgBox "failed to send email with the following error:" & oSmtp.GetLastErrDescription()
    End If

End Sub

Online Tutorial

Send Email using SMTP over SSL/TLS in Delphi
Send Email using SMTP over SSL/TLSin VB6
Send Email using SMTP over SSL/TLS in VC++

Send Email using Exchange WebDAV in Delphi
Send Email using Exchange WebDAV in VB6
Send Email using Exchange WebDAV in VC++

Send Email using Exchange Web Service in Delphi
Send Email using Exchange Web Service in VB6
Send Email using Exchange Web Service in VC++

See Also

User Authentication and SSL Connection
From, ReplyTo, Sender and Return-Path
Process Bounced Email (Non-Delivery Report) and Email Tracking