TextMailProcess

Top  Previous  Next

TextMailProcess is designed to be used in Process Management framework.

Place the element into a ProcessBlock or ProcessForm Element and set its properties.

TextMailProcess

 

Using @vof() function or other MScript functions in Mail properties you can make them dynamic. MScript functions can access and evaluate the values of the input fields in the Process Form.

By placing this element into a repeating ProcessBlock you can create a mass mailing application and send mails with dynamic content to selected user groups.

Properties

SMTP Connection

The sender of the mails.

To, CC, BCC (Accepts MScript)

These are the standard parameters that define the mail recipients.

Subject, Message (Accepts MScript)

The subject and the message text of your E-mail message. The text for the both of them are encoded using the encoding of the current page.

Attachments (Comma delimited) (Accepts MScript)

One or more file names can be specified in this property (by delimiting them with commas) as mail attachments. The names can be defined relative to the web application root or can be absolute file names.

Syntax:

[attachment-name | ] file-name [, [attachment-name | file-name ] ]

 

attachment-name : 

The name of the attachment that will appear in the e-mail. When this optional parameter is omitted the file-name is used as the attachment name.

 

file-name : 

The name of the file to be attached. It can be an absolute file path or it can be defined relative to the web application root.

A process block field name or a pool variable name can also be given instead of a file name. If this is the case the PB field or pool variable should contain the File Object of the file. Using this feature, for example, a pdf document created and placed in a pool variable as a file object by "mor > Fop > FopProcess" can be attached to the e-mail.

 

Examples:

Definition

Attached Object

Attachment names

in e-mail

a.doc

File "{applroot}/a.doc"

a.doc

c:\data\a.doc, b.pdf

File "c:\data\a.doc" and File "{applroot}/b.pdf"

a.doc, b.pdf

/tmp/docs/a.pdf, b.pdf | docs/000.pdf

File "/tmp/docs/a.pdf" and File "{applroot}/docs/000.pdf"

a.pdf, b.pdf

a.pdf | v:pdf1, b.pdf | /tmp/1.pdf 

File Object in pool variable "pdf1" and File "/tmp/1.pdf"

a.pdf, b.pdf

a.pdf | f:pdf1

File Object in process block Field "pdf1"

a.pdf

 

Send In

E-mails can be sent in the foreground or in the background. If big amount of the email is expected to be processed then choose the option "2. Background" so that the user is not locked until the all the emails are sent.

Background Thread Quantity

If the choice of the "Send In" property is "2. Background" then this property can be assigned the number of the sender threads to be started in the background. This feature can be used shorten the sending time.

Log File Name (Accepts MScript)

If a log file name is specified in this property the Mailer component writes the log records in it to report successful and unsuccessful sendings. The file can be specified absolute of relative to the root directory of the web application.

Send Status Target Symbol (Accepts MScript)

The symbol defined here will be assigned a status code right after a mail is attempted to be sent. By checking its value the following processes can make decisions.

f:SEND_STATUS is the default target symbol. This property is valid when "Send In" property is "1. Foreground".

The status codes are:
 
00: Send was OK
04: At least one of the recipient addresses was in error.
08: All of the recipient addresses were in error.
 12: Messaging Exception occurred.

Completion Codes

This Process returns the following completion code

0 Normal completion
12 A mail related error occurred (invalid SMTP account, etc)