Check-Server-capabilities - WeOnlyDo Software example code



All

wodCrypt (12)
wodSSH (10)
wodSFTP (23)
wodSSHServer (1)
wodSSHTunnel (11)
wodSSHpackage
wodSFTPdll

wodSSH.NET (10)
wodSFTP.NET (24)
wodFtpDLX.NET (22)
wodWebServer.NET (10)

wodAppUpdate (13)
wodHttpDLX (8)
wodFtpDLX (22)
wodTelnetDLX
wodFTPServer (3)
wodWebServer (10)
wodVPN
wodXMPP (13)
All ** [Visual Basic] ** [C#] ** [VB.NET] **

Check Server capabilities
VB code
Dim WithEvents wodSMTP As wodSmtpCom
Private Sub Form_Load()

    Set wodSMTP = New wodSmtpCom

    With wodSMTP
        .HostName = "your_smtp_server"
        .Login = "your_login"
        .Password = "your_password"
        
        ' Use Username/Password Authentication
        .Authentication = AuthLogin
    End With

    ' Connect to your SMTP server
    wodSMTP.Connect
    
End Sub

' Once successfully connected to server, we will attempt to send out e-mail.
Private Sub wodSMTP_Connected(ByVal Capabilities As String)
    MsgBox Capabilities, vbOKOnly, "Capabilities supported by server:"
    wodSMTP.Disconnect
End Sub

' This event is used just for debugging purposes. It will display component States
' as it connects to server and sends the message.
Private Sub wodSMTP_StateChange(ByVal OldState As WODSMTPCOMLib.SmtpStates)
    Debug.Print "State changed to " & wodSMTP.StateText
End Sub
VB.Net code
Dim WithEvents wodSMTP As WODSMTPCOMLib.wodSmtpCom
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    wodSMTP = New WODSMTPCOMLib.wodSmtpCom

    With wodSMTP
        .Hostname = "your_smtp_server"
        .Login = "your_login"
        .Password = "your_password"

        ' Use Username/Password Authentication
        .Authentication = WODSMTPCOMLib.SmtpAuthentications.AuthLogin
    End With

    ' Connect to your SMTP server
    wodSMTP.Connect()

End Sub

' Once successfully connected to server, we will attempt to send out e-mail.
Private Sub wodSMTP_Connected(ByVal Capabilities As String)
    MsgBox(Capabilities, MsgBoxStyle.OkOnly, "Capabilities supported by server:")
    wodSMTP.Disconnect()
End Sub

' This event is used just for debugging purposes. It will display component States
' as it connects to server and sends the message.
Private Sub wodSMTP_StateChange(ByVal OldState As WODSMTPCOMLib.SmtpStates)
    Debug.Print("State changed to " & wodSMTP.StateText)
End Sub
C# code
private WODSMTPCOMLib.wodSmtpCom wodSMTP;
private void Form1_Load(object sender, EventArgs e)
{
    wodSMTP = new WODSMTPCOMLib.wodSmtpCom();

    wodSMTP.Connected += new WODSMTPCOMLib._IwodSmtpComEvents_ConnectedEventHandler(wodSMTP_Connected);
    wodSMTP.StateChange += new WODSMTPCOMLib._IwodSmtpComEvents_StateChangeEventHandler(wodSMTP_StateChange);

    wodSMTP.HostName = "your_smtp_server";
    wodSMTP.Login = "your_login";
    wodSMTP.Password = "your_password";
    
    // Use Username/Password Authentication
    wodSMTP.Authentication = WODSMTPCOMLib.SmtpAuthentications.AuthLogin;

    // Connect to your SMTP server
    wodSMTP.Connect();

}
    // This event is used just for debugging purposes. It will display component States
    // as it connects to server and sends the message.
    void wodSMTP_StateChange(WODSMTPCOMLib.SmtpStates OldState)
    {
        Console.WriteLine("State changed to " + wodSMTP.get_StateText(wodSMTP.State));
    }

    // Once successfully connected to server, we will attempt to send out e-mail.
    void wodSMTP_Connected(string Capabilities)
    {
        MessageBox.Show(Capabilities, "Capabilities supported by server:", MessageBoxButtons.OK);
        wodSMTP.Disconnect();
    }