Gets the connected state of the connection.
Syntax
| Visual Basic (Usage) | Copy Code |
|---|
Dim instance As Smtp
Dim value As Boolean
value = instance.Connected |
Property Value
true if the TCP connection is connected to a remote resource and authenticated; otherwise, false.
Example
The following example demonstrates closing the Smtp component's connection.
| Visual Basic | Copy Code |
|---|
' Be sure to import the namespace by putting "Imports Dart.PowerTCP.Mail"
' at the top of your class.
' First check if the Smtp component is connected
If Smtp1.Connected Then
Try
' Try to close gracefully
Smtp1.Close()
Catch ex As Exception
' If an error occurs here, just abruptly close.
Smtp1.Dispose()
End Try
End If |
| C# | Copy Code |
|---|
// Be sure to import the namespace by putting "using Dart.PowerTCP.Mail;"
// at the top of your class.
// First check if the Smtp component is connected
if(smtp1.Connected)
{
try
{
// Try to close gracefully
smtp1.Close();
}
catch(Exception ex)
{
// If an error occurs here, just abruptly close.
smtp1.Dispose();
}
} |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 2.0
See Also