A Message object holds information about an email message. Use the Send method to send the email message. Use the NewMessage property to create a licensed Message object. Using the ExEMail component there are two ways to send email messages: non-blocking and blocking mode. The following sample shows how to send an email message using non=blocking mode:
Dim WithEvents e As EMail Private Sub Form_Load() ' Creates an EMail object, that will receive Message notifications Set e = Runtime1.NewEMail() ' Creates a Message object Dim m As Message Set m = Runtime1.NewMessage() ' Message' notifications are sent through EMail object Set m.Notifier = e ' Sends a message to 2 users m.Send "me@malibu.com", "bula@bulat.com,robingo@calcuta.fom", "Test", "The message has one attchament", "c:\winnt\system32\setup.exe" End Sub
The following sample sends the email message by blocking the application while it delivers the message:
Private Sub Form_Load() ' Creates a Message object Dim m As Message Set m = Runtime1.NewMessage() ' Sends a message to 2 users m.Send "me@malibu.com", "bula@bulat.com,robingo@calcuta.fom", "Test", "The message has one attchament", "c:\winnt\system32\setup.exe" End Sub
Here's the list of supported properties:
Name | Description | |||
Attachment | Retrieves or sets a value that indicates a list of files attached to the message separated by semicolon. | |||
AuthMethod | Retrieves or sets a value that indicates the authentication method. | |||
Bcc | Retrieves or sets a value that indicates the blind carbon copy recipient's email address(s) (separated by commas, if there are more than once). | |||
BodyEncoding | Specifies the way the message's body is encoded. | |||
BodyHTML | Retrieves or sets a the message's body in HTML format. The HTML content is attached as an alternative to plain text. | |||
BodyText | Retrieves or sets the message's body as plain text. | |||
Cc | Retrieves or sets a value that indicates the carbon copy recipient's email address(s) (separated by commas, if there are more than once). | |||
Date | Retrieves or sets the message's date. | |||
DNS | Retrieves the list of DNS servers. | |||
ExtraHeader | Retrieves or sets any extra field to the message's header. | |||
From | Retrieves or sets a value that indicates the email address of the sender. | |||
Helo | Specifies the string being sent by HELO command to the e-mail server. As a result, the receiver-SMTP will not have to perform MX resolution on this name in order to validate the HELO parameter. | |||
Host | Retrieves or sets a value that indicates the host where the message should be delivered. If the Host is empty, the control queries the DNS where the message should be delivered. | |||
LastError | Retrieves the last error that occurs in delivering the message. | |||
LogonPassword | Retrieves or sets the value that indicates the login's password. | |||
LogonUser | Retrieves or sets a value that indicates the login user name. | |||
Notifier | Changes or gets the message's object notifier. The object notifier receives all the message events. | |||
Port | Retrieves or sets the server's port. | |||
Priority | Retrieves or sets a value that indicates the message's priority. | |||
Send | Sends the email message to the recipients. | |||
SendOnce | Indicates whether the message is sent once to the mail server, for all recipients, and the server takes the responsibility to delivery the message per all assigned recipients. | |||
Subject | Retrieves or sets a value that indicates the subject of the message. | |||
Timeout | Specifies the amount of time (in seconds) the control will wait for the server response. | |||
To | Retrieves or sets a value that indicates the recipient's email address, or a list of recipient's email addresses separated by commas. |