[TOC] [Prev] [Next] [Bottom]



Chapter Eighteen

Sending Electronic Mail From Tango


Mail Action

The Mail action sends out electronic mail using the Simple Mail Transport Protocol (SMTP). SMTP is the main protocol used to send mail on the Internet.

The Mail action lets you send e-mail messages from Tango application files and Tango class files. For example, you might send an e-mail message to a list of recipients notifying them of a change to a database or that a particular file has been executed. Many types of information gathering are possible. For example, you can use e-mail for inventory management, shipping and receiving, data compilation, generating sales leads, or any function that can use data derived from activity in a database or an object.

You can also attach files to an e-mail message generated from Tango, add custom headers, and specify the character set and encoding used for the e-mail message.

This chapter covers the following topics:

  • setting up a Mail action
  • disabling the Mail action in Tango.
[top] [back to top]


Setting Up a Mail Action

When you drag the Mail action into your application file, the Mail action editing window appears.

Specify the attributes of your message under the three tabs in the top panel. All of the Mail action fields support the use of Tango meta tags, which are evaluated at the time the e-mail message is sent.

General Tab

For more information, see "mailDefaultFrom". in the Meta Tags and Configuration Variables manual.

For more information, see "Configuring Tango Server"..

  • From. Enter the e-mail address of the sender of your message. Normally, this is also the address that replies and error messages go to.

    If this field is left empty, Tango uses the system configuration variable mailDefaultFrom to determine the default value.

    The value of this configuration variable can be changed in the config.taf application file: enter the address of the person sending the e-mail message, for example, tango@example.com. This configuration variable is stored in the Tango Server configuration file (Tango 2000 Server Preferences).


    ! Note: If both the configuration variable and the From field are empty, then the e-mail message cannot be sent. An e-mail message must always be from somebody.


  • To. Enter the e-mail address or a comma-delimited list of addresses.

  • Cc (Carbon Copy). Enter the e-mail address of the person you want to send a copy of the message to. This field also allows you to enter a comma-delimited list of addresses.

  • Bcc (Blind Carbon Copy). This field is the same as Cc except the recipients are not listed in the message; that is, the To, Cc and other Bcc recipients do not know that the message was also sent to those addresses.

  • Subject. Enter the subject of the e-mail message.

You compose your e-mail message in the bottom pane of the Mail action window.

Proper E-Mail Address Syntax

You must use a valid e-mail address format in the From, To, Cc, and Bcc fields of the Mail action. The following formats are supported by Tango Server:

  • johndoe@example.com

    e-mail address.

  • <johndoe@example.com>

    e-mail address in angle brackets.

  • "John Doe" <johndoe@example.com>

    name in quotes, e-mail address in angle brackets.

  • johndoe@example.com (John Doe)

    e-mail address, name in parentheses.


! Note: Some e-mail clients may not show the name when displaying an e-mail header if you use the format shown in the final example.


Options Tab

Click the Options tab and specify how you want your message to appear to the recipient, as shown in the following fields:

  • Content Type. Specify the output format of your e-mail message by selecting Plain Text or HTML from the pop-up menu, or enter a content type in the text field provided.

  • Character Set. Select an option from the pop-up menu to specify the character format for the e-mail message.


    ! Note: When the message is sent, Tango Server adds the following MIME header lines, displaying the message to the recipient in the chosen content type and character set:

    MIME-Version 1.0
    Content-type:
    type; charset="charset"
    Content-transfer-encoding: encoding
    X-Mailer: Tango 2000 <@VERSION>

    The type, charset, and encoding options are replaced by the content type (for example, text/plain or text/html), character set (for example, ISO-8859-1), and encoding (for example, quoted-printable) selected by the user.


  • Wrap Lines At. Enter the line length of your message body. The value of this field must be between 30 and 132 characters. The default value is 72 characters. This field is available when the Character Set option is set to ASCII or a user-entered value. With non-ASCII character sets, no wrapping occurs.

  • Custom Header Lines. Enter text or meta tags that are to be displayed as custom headers at the end of the message headers. Data in this field should not exceed 32K.

Attachments Tab

  • Click the Attachments tab to attach a file to your message.

To attach a file to a message
  1. Do one of the following:

    • From the Edit menu, choose Insert.

    • Control+click in the Attached Files window and choose Insert... from the contextual menu that appears.

  2. Specify the full path and name of the file to be attached; for example, Macintosh HD:Outbox:Attach:MyAttachment.


! Note: The paths specified here are appended to the value of the absolutePathPrefix configuration variable. If this configuration variable has a value (in either application or system scope), this field should contain a path relative to that location. For more information, see "absolutePathPrefix" in the Meta Tags and Configuration Variables manual.


For each path field, meta tags can be inserted to a maximum length of 1024 characters. Tango evaluates meta tags in the file path for each attachment in the list. After meta tag substitution, Tango determines whether the value is text or an array. If the value is an array, Tango processes every cell in the array as a separate file path.

For example, you could enter the following in a field in the Attached Files section of the Mail action dialog box:

@@myFiles

When the application file is executed, the file or files specified by the variable myFiles (single value or array) are attached to the generated e-mail message.

When the Mail action is executed, Tango Server connects to the SMTP server. Tango then sends the message to all the specified recipients.

For more information, see mailPort in the Meta Tags and Configuration Variables manual.

For more information, see "Configuring Tango Server".

The SMTP server is defined by the configuration variables mailServer and mailPort. These variables can be changed using the config.taf application file. They are stored in the Tango Server configuration file (Tango 2000 Server Preferences).

The result of the action is a one-column array of the messages sent to and received from the SMTP server. Use <@COL 1> inside a <@ROWS> block in the Mail action's Results HTML to display these results. This information can be useful for debugging a Mail action.

The resultSet for a Mail action shows both the mail server's and the client's side of the SMTP conversation, and the commands Tango sends to the mail server.

[top] [back to top]


Disabling Mail

For more information, see "Configuring Tango Server".

You can specify that mail attachments can only come from a specified directory of Tango Server using the absolutePathPrefix configuration variable. Using this configuration variable to set the path for mail attachments ensures that users cannot access directories other than the specified ones when using the Mail action. This configuration variable also affects all other actions which have absolute paths as parameters.

For more information, see "Configuring Tango Server".

Mail actions are enabled in Tango by default. If you want to disable (or enable) this feature, you can do so by changing the following option in the config.taf application file Feature Switches screen:

mailSwitch

Check or uncheck the checkbox beside the option.



[TOC] [Prev] [Next] [Bottom]



docs@pervasive.com

Copyright © 1999, Pervasive Software. All rights reserved.