OstroSoft - Home of Internet Tools
OstroSoft SMTP Component (OSSMTP.dll)

• Description   • Installation   • Licensing   • Object Reference  

SMTPSession
Attachments
Attachment
CustomHeaders
CustomHeader
Component object model
(for more information click on object)

Description

COM library for sending emails from Visual Basic 6 and other COM-compliant programming and scripting languages. Supports multiple recipients, email (MIME) attachments, AUTH and POP3 authentication, HTML email, custom headers.

By using OSSMTP.dll you agree to terms of License Agreement

Installation

for use with Visual Basic 6 (any edition):
1. download smtp_component.zip
2. from downloaded file unzip OSSMTP.dll to Windows System directory
3. run "regsvr32 OSSMTP.dll" from command-line

for use with .NET, Visual Basic 4 or 5, Visual C++, ASP, VBA, VBScript, JavaScript or any other language, supporting COM:
1. download smtp_component.exe
2. run downloaded file from Windows Explorer or command-line

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

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)

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

* 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)