scriptella.driver.mail

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 geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
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:user@nosuchhost.com?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: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>
    
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.
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.