OstroSoft - Home of Internet Tools
OstroSoft SMTP Component

SMTPSession
Attachments
Attachment
CustomHeaders
CustomHeader
EmbeddedObjects
EmbeddedObject
Component object model

Description

OstroSoft SMTP Component is a software library for sending emails programmatically. Supports multiple recipients, email (MIME) attachments, AUTH and POP3 authentication, HTML email, custom headers, embedded objects, SSL.

OSSMTP.dll is a COM library. Use it with Visual Basic 6 and earlier, VBA, VBscript, Javascript, MS SQL server and other programming languages and environments supporting COM.

OSSMTP_Plus.dll is a .NET library. Use it with C#, VB.NET and other programming languages and environments supporting .NET.

By using OstroSoft SMTP Component you agree to terms of License Agreement

Installation

1. download OSSMTP.zip
2. extract downloaded file to a local directory
3. if you are planning to use OSSMTP.dll, copy it to your system directory and register with regedt32
4. if you are planning to use OSSMTP_Plus.dll, copy it to a root directory of your .NET project

Licensing

Non-commercial licensefree
Unlimited usage for developing non-commercial applications.
Developer license$19.00(purchase)
For a single programmer to develop and distribute a single commercial application.
Server license$59.00(purchase)
For use in a commercial application, installed on a single server.
Enterprise license$139.00(purchase)
For programmers within a company to develop and distribute an unlimited number of commercial applications.


Object reference
SMTPSession object

Methods:
object.SendEmail()
Compose email, connect to mail server, authenticate (if necessary), send the message, close SMTP session
object.SaveToEML(FILE_NAME As String)
Save message in EML format

Events:
object_ConnectSMTP()
Connected (and authenticated) to SMTP server
object_SendSMTP()
Message successfully sent
object_CloseSMTP()
SMTP session closed
object_ErrorSMTP(Number As Long, Description As String)
Error occured
object_StatusChanged(Status As String)
Status property changed
object_MessageSaved()
Message successfully saved

Properties:
object.AuthenticationType As authentication_type (Integer)
Type of authentication schema. The following authentication_type constants are defined:
valuenamedescription
0 (default)AuthNoneno authentication
1AuthPOPauthentication via POP3 session
2AuthLoginAUTH LOGIN
3AuthPlainAUTH PLAIN
object.BCC As String
Black Carbon Copy - "invisible" message recipient (or list of recipients)
object.CC As String
Carbon Copy - recipient (or list of recipients), receiving the copy of the message
object.Charset As String
Character set used in message (default - "us-ascii")
object.ClientHostName As String
Host name used in HELO/EHLO commands (optional)
object.ContentTransferEncoding As String
Content transfer encoding of the message body (default - "7bit")
object.ContentType As String
Content type of the message body (default - "text/plain")
object.ExpiresAfter As String
Message expiration date (optional)
Format: dd mmm yyyy hh:nn:ss +0000
Example: 11 Feb 2005 16:03:05 -0500
object.Importance As importance_level (Integer)
Message priority/importance level. The following importance_level constants are defined:
valuenamedescription
0 (default)ImportanceNormalNormal priority/importance
1ImportanceLowLow priority/importance
2ImportanceHighHigh priority/importance
object.LastSMTPCommand As String
Last SMTP command sent by component
object.MailFrom As String
Sender of the message (email address and optional name)
object.MessageHTML As String
HTML part of the message
object.MessageSubject As String
Subject of the message
object.MessageText As String
Text of the message
object.Notification As notification_type (Integer)
Notify sender when message is delivered and/or opened by recipient (default - no notification). The following notification_type constants are defined:
valuenamedescription
0 (default)NotificationNoneno notification
1NotificationDeliverynotification on delivery
2NotificationReadnotification on read
3NotificationDeliveryAndReadnotifications on delivery and read
object.Password As String
Password used to authenticate to mailserver
object.POPServer As String
Hostname or IP address of server, used during POP3 authentication
object.Port As Long
Port of SMTP server (default - 25)
object.RaiseError As Boolean
Defines the component behavior when error occurs. When property set to True, component raises an error, otherwise - fires ErrorSMTP event
object.ReplyTo As String
Email address (list of email addresses), defining recipient(s) of reply to this message (default - same as MailFrom)
object.SendTo As String
Recipient (list of recipients) of the message
object.Sensitivity As sensitivity_level
Defines scope of the message. The following sensitivity_level constants are defined:
valuename
0 (default)SensitivityNormal
1SensitivityPersonal
2SensitivityPrivate
3SensitivityConfidential
object.Server As String
Hostname or IP address of SMTP server
object.Status As String
Current status of component
object.Timeout As Long
Connection timeout in milliseconds (default - 10000)
object.TimeStamp As String
Time when message was generated (default - system date/time)
object.Username As String
Username used to authenticate to mailserver
object.UseSSL As Boolean
When set to true, uses secure SMTP authentication and session (over TLS/SSL)

Attachments collection
contains message attachments

Supports following methods:
collection.Add oAttachment, [oAttachment_ID]
adds new Attachment object ([oAttachment_ID] - optional attachment ID)
collection.Remove object.Attachments(oAttachment_ID)
removes specified Attachment object (oAttachment_ID - attachment ID or Index)
collection.Count
returns number of attachments
collection(oAttachment_ID)
returns specified Attachment object (oAttachment_ID - attachment ID or Index)

CustomHeaders collection
contains message custom headers

Supports following methods:
collection.Add oCustomHeader, [oCustomHeader_ID]
adds new CustomHeader object ([oCustomHeader_ID] - optional CustomHeader ID)
collection.Remove object.CustomHeaders(oCustomHeader_ID)
removes specified CustomHeader object (oCustomHeader_ID - CustomHeader ID or Index)
collection.Count
returns number of custom headers
collection(oCustomHeader_ID)
returns specified CustomHeader object (oCustomHeader_ID - CustomHeader ID or Index)

EmbeddedObjects collection
contains embedded objects for use in HTML part of the message

Supports following methods:
collection.Add oEmbeddedObject, [oEmbeddedObject_ID]
adds new EmbeddedObject object ([oEmbeddedObject_ID] - optional embedded object ID)
collection.Remove object.EmbeddedObjects(oEmbeddedObject_ID)
removes specified EmbeddedObject object (oEmbeddedObject_ID - embedded object ID or Index)
collection.Count
returns number of embedded objects
collection(oEmbeddedObject_ID)
returns specified EmbeddedObject object (oEmbeddedObject_ID - embedded object ID or Index)

Attachment object

object.AttachmentName As String
Attachment name (optional, default - file name from file path)
object.ContentTransferEncoding
Content-transfer-encoding of attachment (optional, default - base 64)
object.ContentType As String
Content-type of attachment (optional, default - Registry setting corresponding to file extension)
object.FilePath As String
Location of attachment source

CustomHeader object

object.HeaderName As String
Header name
object.HeaderValue As String
Header value

EmbeddedObject object

object.ContentType As String
Content-type of embedded object (optional, default - Registry setting corresponding to file extension)
object.FilePath As String
Location of embedded object source
object.ObjectID As String
Embedded object ID (optional, default - file name from file path)

* You can specify multiple recipients in SendTo, CC and BCC fields, using comma-separated list:
<addr2@yourhost.com>, addr1@yourhost.com,"recipient name" <addr3@yourhost.com>
* view SMTP component error reference
* using Attachment and CustomHeader objects is not required. Both Attachments and CustomHeaders collections will accept string variables (use <file-path> for Attachments, <header-name: header-value> for CustomHeaders)