|
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:
value | name | description |
0 (default) | AuthNone | no authentication |
1 | AuthPOP | authentication via POP3 session |
2 | AuthLogin | AUTH LOGIN |
3 | AuthPlain | AUTH 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:
value | name | description |
0 (default) | ImportanceNormal | Normal priority/importance |
1 | ImportanceLow | Low priority/importance |
2 | ImportanceHigh | High 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:
value | name | description |
0 (default) | NotificationNone | no notification |
1 | NotificationDelivery | notification on delivery |
2 | NotificationRead | notification on read |
3 | NotificationDeliveryAndRead | notifications 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:
value | name |
0 (default) | SensitivityNormal |
1 | SensitivityPersonal |
2 | SensitivityPrivate |
3 | SensitivityConfidential |
|
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: