scriptella.driver.mail

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Natural Language Processing
51.Net
52.Parser
53.PDF
54.Portal
55.Profiler
56.Project Management
57.Report
58.RSS RDF
59.Rule Engine
60.Science
61.Scripting
62.Search Engine
63.Security
64.Sevlet Container
65.Source Control
66.Swing Library
67.Template Engine
68.Test Coverage
69.Testing
70.UML
71.Web Crawler
72.Web Framework
73.Web Mail
74.Web Server
75.Web Services
76.Web Services apache cxf 2.2.6
77.Web Services AXIS2
78.Wiki Engine
79.Workflow Engines
80.XML
81.XML UI
Java Source Code / Java Documentation  » Scripting » scriptella » scriptella.driver.mail 
scriptella.driver.mail

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:

  • In addition to the above mentioned properties the driver supports all JavaMail environment properties.
  • Connection properties may be specified inside a connection element or as a a part of URL, e.g. mailto:[email protected]?subject=Hello
  • This driver supports dynamic properties substitution in an URL, e.g. mailto:$email?subject=$subject ,it makes possible sending emails to recipients specified by in a row set.

Examples

The following example sends a simple text message

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

Use type=html property to send HTML content.

<etl>
    <connection driver="mail" url="mailto:[email protected]?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;[email protected]&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;[email protected]&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>
    
Java Source File NameTypeComment
Driver.javaClass Represents a JavaMail driver.
MaiConnectionTest.javaClass Tests for MailConnection .
MailConnection.javaClass Represents a JavaMail connection.
MailDriverTest.javaClass Tests for scriptella.driver.mail.MailConnection .
MailProviderException.javaClass Thrown to indicate a problem with EMail producing/sending.
w___w__w__.___j__a_va___2s__._c___o_m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.