This is a fairly simple JavaScript class used for the generation of SMTP email messages. The object basically
consists of a number of optional fields that can be provide and a single method - 'send()' - to format and
send to e-mail to a remove (or local) SMTP daemon.
Name | Type/Value | Range/Length | Description |
operation | number | | Optional, default = SmtpRequest.sendToValid
Determines the behaviour of the send() operation. Options are :
- SmptRequest.sendToValid (default)
Validates all addresses. Any invalid addresses are reported but the email is sent anyway to all valid addresses - SmptRequest.abortOnAddressError
Validates all addresses. The email is sent only if all addresses are valid. If any addresses are
invalid then the operation is cancelled - no email will be sent - SmptRequest.validateAddresses
All target email addresses are validated through the mail server and 'bad' addresses are reported. Email is
never sent.
|
subject | string | | Required.
The subject line for the email.
|
from | string | | Required.
The from email address for the email.
|
sender | string | | Required.
The from email address for the email.
|
replyTo | string | | Required.
Value for the 'Reply-To' header.
|
to | array of strings | | Optional.
An array of email addresses. Unless the message has 'rawData' set the contents of this field populates the 'To' field in
the email generated. If the 'envTo' property is empty then this field is aggregated with 'cc' and 'bcc' to generate
the actual set of recipients for this message.
|
cc | array of strings | | Optional.
An array of email addresses. Unless the message has 'rawData' set the contents of this field populates the 'Cc' field in
the email generated. If the 'envTo' property is empty then this field is aggregated with 'to' and 'bcc' to generate
the actual set of recipients for this message.
|
bcc | array of strings | | Optional.
Blind copy. An array of email addresses. If the 'envTo' property is empty then this field is aggregated with 'to' and 'cc' to generate
the actual set of recipients for this message.
|
rawData | bool | | Optional, default = false
If this flag is 'true' then the Presentation Engine takes the contents of the 'defaultText' field as both the headers and the body (i.e.
the Presentation Page has full control over the e-mail data. Note that in this case the 'defaultText' field is mandatory.
|
body | array of struct SmtpRequest.SmtpBodys | see definition | Required.
One or more body segments. This can be an array object or a single object. Each object maybe either
be a binary object or will be converted to a string.
|
defaultText | string | | Optional. This text field is used in one of two ways: - If the message has a multi-part encoding then this property is inserted into the message before the start of the first part.
- If the 'rawData' flag is set to 'true' then this property contains the entire data for the email- both the headers and the body. The
only thing the presentation deals with is generation of the email envelope.
In all other cases this property is ignored. |
multipart | string | | Optional, default = mixed
*If* the email generated is determined to have a multipart content (the body property is an array with more than one element) then this
property deterimes the sub-type of the content type. So for example if this property is set to 'alternate' then the Content-Type
header will contain 'multipart/alternate'. |
headers | MetaData | | Required.
Set of headers to send to the server. Each property on this object is a header name and the value is the header value.
|
HELO | string | | Required.
Use a specific domain name in the HELO (or EHLO) request to remote servers. By default the systems host name will be used.
|
useDSN | bool | | Optional, default = false
If set to 'true' when 'send()' is called will request that the receiving system provide
"Delivery Service Modifications". The SmtpRequest class
will interrogate the following attributes to further refine the DSN request: notifyFail; notifySuccess; notifyDelay; returnBody; envID;
|
notifyFail | bool | | Optional, default = true The receiving server should return a DSN report if delivery fails. |
notifySuccess | bool | | Optional, default = false The receiving server should return a DSN report if delivery succeeds. |
notifyDelay | bool | | Optional, default = false The receiving server should return a DSN report if delivery is delayed. |
returnBody | bool | | Optional, default = false The receiving server should return the entire message body in any DSN report sent. |
envID | string | | Required. If useDSN is true then the string value of this property will be used as the 'envelope ID' for the
outgoing message. This should then be returned in any correctly formatted DSN respnse. An application can
place a value in this property that allows it to subsequently map the DSN response to a specific outgoing
message. |
envFrom | string | | Required. Specify a value for the 'envelope-from' header. This address overrides the target address to which bounce/DSN messages will be sent. In conjunction with DSN this allows application
software to automatically process bounce messages and facilitates automated list management and cleaning. |
failedRecipients | array of struct SmtpRequest.FailedRecipients | see definition | Required.
One or more body segments. This can be an array object or a single object. Each object maybe either
be a binary object or will be converted to a string.
|