PowerTCP Mail for .NET
Smtp Constructor(IContainer)
See Also  Example Send comments on this topic.
Dart.PowerTCP.Mail Namespace > Smtp Class > Smtp Constructor : Smtp Constructor(IContainer)




container
The IContainer which contains the Smtp component.
Initializes a new instance of the Smtp component.

Syntax

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.

Example

The following example demonstrates the Smtp component constructors.
Visual BasicCopy 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);

Remarks

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

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

Documentation Version 3.2
© 2010 Dart Communications. All Rights Reserved.