http://onionworks.net/2004/renderengine/email

send (mail : nodeset) : string

The general structure of an email and the possible attributes are explained here.

Below is an example structure of an email variable and its subsequent sending.

<xsl:variable name="mail">
<mail mailserver="mx.example.com" subject="" reply-to="reply-to@example.com">
<sender e-mail="sender@example.com" name="Sender" />
<recipient e-mail="recipient1@example.com" name="Recipient 1" />
<recipient e-mail="recipient2@example.com" name="Recipient 2" type="to" />
<recipient e-mail="recipient3@example.com" name="Recipient 3" type="cc" />
<recipient e-mail="recipient4@example.com" name="Recipient 4" type="bcc" />
<body>
<text>This e-mail has text content</text>
<html>
<p> This e-mail hast
<strong>html</strong>
content too. </p>
</html>
</body>
<attachments>
<file xlink="onion://data/objects/1#icon" physical-filename="icon.png" target-filename="onion-icon.png"> </file>
</attachments>
</mail>
</xsl:variable>
<xsl:value-of select="email:send($mail)" />

The result of the example is: success or error.

<mail>-Element

The mandatory attribute “mailserver” indicates the sending server for the email. In order to set the subject of the email, the attribute “subject” is set on the mail element. This attribute is also mandatory. If no subject is set, then the attribute “empty” must be set.

If the recipients of the email are not supposed to reply to the email address of the sender, then “reply-to” can be set as the attribute of the mail element.

<sender>-Element

The sender element is mandatory and may only appear once as the first element below the mail element. “e-mail” is to be set as the mandatory attribute of the sender element. A symbolic name (“name” attribute) can be allocated for the sender as an option. This name is usually displayed behind the email address in email clients.

<recipient>-Element

This element is similar to the sender element. The attribute “e-mail” must be set for each recipient element and the attribute “name” can be set for a symbolic name as an option.

In addition, there is the attribute “type”, which specifies how the recipient is to receive the email. The values to, cc, bcc are possible. If this attribute is not set, then the default value is "to".

If several recipients are to receive this email, then several recipient elements can simply be added for each recipient.

<body>-Element

The element “text”, which contains plaintext, can be set as a sub-element of the “body” element. The “html” element can be set after the “text” element as a further sub-element of the “body” element. HTML content can now be contained in the “html” element.
If the email does not contain any text or html content, then the text/html element can be left out.

<attachments>-Element

If one or more file attachments are to be added to an email, then the files are added below the “attachments” element. For this purpose, a file element with the attributes described below is defined for each file to be attached.

“xlink” is to be set as the mandatory attribute for the file element. The xlink must be an XLink to a binary method of the file to be attached. A further mandatory attribute is “target-filename”, which is the display filename of the attachment.

A physical file name can be specified for the file attachment as an option. If this name is not set, then the file name is used which supplies the specified binary method.