Version: 2.12.0.0
Use controls to create, send, retrieve, preview and edit Internet email messages.

Smtp ActiveX Control

Use the Smtp control to send email to any Internet email (SMTP) server. Features include:

  • Explicit and Implicit SSL Security.
  • Create a ready-to-send HTML email message with a single line of code.
  • Use in conjunction with the Pop control or Imap control to build complete mail solutions.
  • Create and send messages of any level of complexity, from simple text emails to complex multi-part MIME messages.
  • Detailed knowledge of SMTP is not required.
  • Enhanced SMTP commands such as 8BITMIME, PIPELINING, SIZE and Delivery Status Notifications are automatically used if advertised by the server.
  • Encoded/decoded messages need not be spooled to disk, making this product a real performer for messages buffered in memory.
  • One method call builds and sends a message.

 

Looking for the .NET version of this control?

 

Interface

 

Public Properties
Blocked A True value indicates the control is currently executing a blocking method (Timeout is greater than 0), which has neither completed nor timed out with a ptTimeout error.
Capabilities Collection of strings that contains the protocol extensions supported by the server. Values are initialized during login.
Certificate

Client certificate.

From If provided, this return address is used for the SMTP envelope instead of the address found in the From header label of the message.
Message Default Message Object to send.
Privacy

Security mode, such as Explicit, Implicit, None.

Security

FOr handling server certificates.

State Provides status information to the user interface. The State event fires to signal that this property has changed.
Timeout Controls the blocking behavior of methods that can be used in blocking and non-blocking ways.
To If provided, these addresses will be used for the SMTP envelope instead of those found in the To, Cc, and Bcc header labels of the message.
Public Methods
Abort Abort any blocking method and release all system resources.
About Show the About Box.
ClearCertificate

Clear the client certificate.

Command Send any protocol command to the server.
DSN Set parameters that define the type of Delivery Status Notification that will be requested for subsequent messages.
Login Establish a session.
Logout End a session.
QuickSend Build and send a message in one easy step.
Reset Recover from an error condition.
Send Send a mail message.
Trace Start or stop the accumulation of trace or debug data. Once started, this method accumulates data until it is turned off.
Verify Validate an email address.
Public Events
Authenticate

Presents the server certificate.

Certificate

Client certificate requested.

Error Fires when an error condition occurs.
Progress Fires when a method has completed, the server has sent a reply, or progress information is available.
State Fires when the State property changes.

Code Example

How easy is the SMTP control to use? Check out the VB examples below.

Example 1: The first example demonstrates the quickest and easiest way to send mail.

' Send mail with a single line of code using the QuickSend method (specifying 
' "To", "From", "Subject", "Text" and the server used as parameters).
Smtp1.QuickSend "you@test.com", "me@test.com", "Test", _
                "This is a message", , "mail.test.com"

Example 2: The second example demonstrates creating a message with an attachment, using the Message object.

Smtp1.Message.To.Add "you@test.com" ' Specify the recipient
Smtp1.Message.From = "me@test.com" ' Specify the sender
Smtp1.Message.Subject = "Test Message" ' Specify the subject
Smtp1.Message.Text = "This is a test." ' Add message body
Smtp1.Message.AddAttachment "C:\company.gif" ' Add attachment
Smtp1.Login "mail.dart.com" ' Start the mail session
Smtp1.Send ' Send message
Smtp1.Logout ' End session