Mail

KCM Core sends an email with optional attached documents to any valid recipient.

The SMTP host must support the minimum requirements as described in RFCs 821 and 822.

KCM Core uses MIME enhancements if the email contains 8-bit characters. Attachments are sent using MIME enhancements. MIME types for attachments are read from the Registry. If the MIME type cannot be read from the Registry, the file is sent binary with application/octet-stream as MIME type.

In general, you can use any Internet email gateway as a SMTP host.

To learn how to construct a valid email message, see Send email from a script.

Syntax

Mail
   File(<text>)
   Host(<text>) 
   From(<text>) 
   To(<text>) 
   Attachments(<text>) 
   Preformatted(<True or False>) 
   Port(<text>)
   MimeEncoding(<text>); 

Parameters

  • File: Required. The header and MIME body of the email.
  • The header in this file is the human readable header of the mail. Include Subject:, To:, and Reply-to: in this header. For more information, see Send email from a script. The body of this file is also sent, but is only shown if the recipient has an email client that does not support MIME enhancements or when no Attachments parameter is passed. It is customary that this file should contain a message informing the recipient that he or she needs MIME support to access the attachments.
  • Host: Required. The SMTP host that KCM Core uses to send the email.
  • From: Required. The User Name used to transmit the email. This user name must be specified in the user@hostname.domain format. KCM Core needs this user name to authenticate the sender to the SMTP host.
  • To: Required. A string containing a comma-separated list of recipients of the email. Every recipient must be specified in the user@hostname.domain format.
  • Attachments: Optional. A string containing a comma-separated list of documents that KCM Core attaches to the email message as MIME attachments. The first two of these attachments are the alternative bodies of the email using the rules described in the following table.

File extension first file

File extension second file

Body alternative sent: TXT/HTML*

TXT

HTML

Body alternative sent: TXT/HTML*

HTML

TXT

Body alternative sent: TXT

TXT

Not HTML

*Which of the provided alternative bodies is shown depends on the setting of the mail client.

For more information on the MIME enhancement, see Send email with an attachment.

Inline image in HMTL Body

Inline images are supported (Content_ID header support). For more information, see HTML inline images.

Preformatted: Optional. If this parameter is set to Y, the document provided with the File (<text>) parameter is considered to contain a complete, formatted email, including all headers and attachments. The value of the parameter Attachments (<text>) is ignored in this case.

Port: Optional. The number or symbolic name of the port that KCM Core connects to on the host. If this parameter is not specified, KCM Core uses the standard SMTP port (port 25).

MimeEncoding: Optional. The encoding used to send the HTML part of the body. This setting must match the encoding used to generate the HTML page as it does not convert the page. Some mail clients use this attribute to determine the encoding instead of the appropriate metadata tags embedded within the HTML page.

The command SimpleMail offers a simpler interface for producing elementary email. For more information, see SimpleMail.