ImagoX Mail Extension 

The ImagoX Mail Extension is an implementation of a mail sending mechanism. ImagoX Mail can send email to one or more "to" or "bcc" addresses, and HTML markup may be included.


The configuration for this extension must be placed in the imago.properties file. All configuration options must be prefixed with org.xenei.imagox.ImagoMail. For options that begin with <defaults> the <defaults> tag should be replaced with the name of the default options. In the example the defaults are defined as "special". This set of defaults is used in Example 2. ImagoX extension configuration information is available here.
org.xenei.imagoX.ImagoMail.mail.smtp.host=
The SMTP mail host. If not specified it defaults to localhost.

org.xenei.imagoX.ImagoMail.<defaults>.from=
Defines the from parameter if not defined in the attribute list.

org.xenei.imagoX.ImagoMail.<defaults>.to=
Defines the to parameter if not defined in the attribute list. This may be a comma separated list of email addresses.

org.xenei.imagoX.ImagoMail.<defaults>.bcc=
Defines the bcc (blind carbon copy) parameter if not defined in the attribute list. This optional parameter may be a comma separated list of addresses.

org.xenei.imagoX.ImagoMail.<defaults>.reply-to=
Defines the reply-to parameter if not defined in the attribute list. This is an optional parameter.

org.xenei.imagoX.ImagoMail.<defaults>.subject=No Subject
Defines the subject of the email if not defined in the attribute list.

org.xenei.imagoX.ImagoMail.subject=Standard Subject
Defines the standard subject of the email if not defined in the attribute list.

org.xenei.imagoX.ImagoMail.bcc=
Defines a bcc (blind carbon copy) list that all messages will be sent to. This comma-separated list is optional and will be appended to any addresses specified in the <defaults>.bcc and the bcc attribute.

Example 1:

This example does not use the <defaults> mechanism and so specifies every option in the XML and XSL documents.

XML

<mail
    to="foo@xenei.net, bar@xenei.net"
    from="example1@xenei.net"
    bcc="theLurker@xenei.net"
    cc="archives@xenei.net"
    reply-to="webmaster@xenei.net"
    subject="The example 1 message"
    >
    This is the body of the message.
    Any HTML markup will be transformed using the current stylesheet.
</mail>


XSL

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0"
    xmlns:xmail="xalan://org.xenei.imago.extensions.ImagoMail"
    extension-element-prefixes="xmail"
>
....
<xsl:template match="mail">
    <xmail:send
        to="{@mailto}"
        from="{@mailfrom}"
        subject="{@subject}">
        to="{@to}"
        from="{@from}"
        bcc="{@bcc}"
        cc="@{cc}"
        reply-to="@{reply-to}"
        subject="{@subject}"
    >
    <xsl:apply-templates/>
    </xmail:send>
</xsl:template>



Example 2:

This example uses the <defaults> mechanism. The defaults are shown as "special" here.

XML

<mail default="special">
    This is the body of the message.
    Any HTML markup will be transformed using the current stylesheet.
</mail>

XSL

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0"
    xmlns:xmail="xalan://org.xenei.imago.extensions.ImagoMail"
    extension-element-prefixes="xmail"
>
....
<xsl:template match="mail">
    <xmail:send
        default="{@default}"
        to="{@mailto}"
        from="{@mailfrom}"
        subject="{@subject}">
        to="{@to}"
        from="{@from}"
        bcc="{@bcc}"
        cc="@{cc}"
        reply-to="@{reply-to}"
        subject="{@subject}"
    >
    <xsl:apply-templates/>
    </xmail:send>
</xsl:template>


Go to ImagoX Extensions.