Skip navigation links

Package scriptella.driver.mail

E-Mail Driver for Scriptella.

See: Description

Package scriptella.driver.mail Description

E-Mail Driver for Scriptella.

Allows sending E-Mails via SMTP.

General information

Driver class:scriptella.driver.mail.Driver
URL:URL specifies TO recipients using the mailto scheme: mailto:sAddress[sHeaders]
Runtime dependencies: mail.jar and activation.jar

Driver Specific Properties

Name Description Required
type Specifies type of E-Mail message content: text or html. No, default value is text.
subject Specifies e-mail subject. No.
mail.host Specifies the default Mail server. No, see JavaMail Environment Properties for details
mail.from Specifies e-mail address of sender. No, see JavaMail Environment Properties for details

Properties substitution

Mail script elements support ${property} or $property syntax for properties/variables substition. Additionally connection URL parameter supports dynamically resolved binding variables.
Example:
mailto:$email, the email variable would be reevaluated if mail script is executed by a parent query.

Notes:

Examples

The following example sends a simple text message

<etl>
    <connection driver="mail" url="mailto:user@nosuchhost.com?subject=Hello"
            classpath="mail.jar:activation.jar">
        mail.smtp.host=mail.host.name
        mail.user=user
        mail.password=password
        mail.from=Firstname Lastname &lt;user@nosuchhost.com&gt;
    </connection>
    <script>Message produced by Scriptella ETL</script>
</etl>
    

Use type=html property to send HTML content.

<etl>
    <connection driver="mail" url="mailto:user@nosuchhost.com?subject=Hello"
            classpath="mail.jar:activation.jar">
        type=html
        mail.smtp.host=mail.host.name
        mail.user=user
        mail.password=password
        mail.from=Firstname Lastname &lt;user@nosuchhost.com&gt;
    </connection>
    <script><![CDATA[
        <html>
            <body>
                Hello,
                <hr>
                <a href="http://scriptella.javaforge.com/" title="Powered by Scriptella ETL">
                    <img src="http://scriptella.javaforge.com/images/scriptella-powered.gif" 
                            width="88" height="31" border="0" alt="Powered by Scriptella ETL">
                </a>
            </body>
        </html>]]>
    </script>
</etl>
    

The following example sends a message to a list selected from the database

<etl>
    <connection id="mail" driver="mail" url="mailto:$email?subject=Hello $name"
            classpath="mail.jar:activation.jar">
        mail.smtp.host=mail.host.name
        mail.user=user
        mail.password=password
        mail.from=Administrator &lt;user@nosuchhost.com&gt;
    </connection>
    <connection id="db" .../>
    <query connection-id="db" >
        SELECT * FROM Users
        <script connection-id="mail">
            #$rownum
            Message produced by Scriptella ETL
        </script>
   </query>
</etl>
    
Skip navigation links

Copyright © Copyright 2006-2019 The Scriptella Project Team.