| Visual Basic (Declaration) | |
|---|---|
Public Function New( _ ByVal container As IContainer _ ) | |
| Visual Basic (Usage) | Copy Code |
|---|---|
Dim container As IContainer Dim instance As New Smtp(container) | |
| C# | |
|---|---|
public Smtp( IContainer container ) | |
| Managed Extensions for C++ | |
|---|---|
public: Smtp( IContainer* container ) | |
| C++/CLI | |
|---|---|
public: Smtp( IContainer^ container ) | |
Parameters
- container
- The IContainer which contains the Smtp component.
The following example demonstrates the Smtp component constructors.
| Visual Basic | Copy Code |
|---|---|
' Be sure to import the namespace by putting "Imports Dart.PowerTCP.Mail" ' at the top of your class. ' Create a default instance Dim smtp1 As New Smtp() ' Create an instance, passing in a reference to the container Dim smtp2 As New Smtp(Me.components) | |
| C# | Copy Code |
|---|---|
// Be sure to import the namespace by putting "using Dart.PowerTCP.Mail;" // at the top of your class. // Create a default instance Smtp smtp1 = new Smtp(); // Create an instance, passing in a reference to the container Smtp smtp2 = new Smtp(this.components); | |
Use this constructor to add the Smtp component to the IContainer container. When using Visual Studio.NET, simply add the Smtp component to the form and the object will automatically be created and initialized. If working out of the Visual Studio.NET environment (or using the Smtp component as a reference), the Smtp component will have to be explicitly created and initialized.
For information on how to use the Smtp component, see "Using PowerTCP Secure Mail for .NET".
The following table shows initial property values for an instance of Smtp.
| Property | Initial Value |
|---|---|
| AutoSize | true |
| Busy | false |
| Client | zero-length string |
| ClientPort | 0 |
| Connected | false |
| Connection | Tcp component |
| DoEvents | true |
| DSN | DeliveryStatusNotification class |
| MailFrom | null |
| Password | zero-length string |
| Recipients | MailAddresses object |
| Server | zero-length string |
| ServerPort | 25 |
| Timeout | 30000 |
| Username | zero-length string |
Target Platforms: Microsoft .NET Framework 2.0