Class | Description |
---|---|
Driver |
Represents a JavaMail driver.
|
MailConnection |
Represents a JavaMail connection.
|
Exception | Description |
---|---|
MailProviderException |
Thrown to indicate a problem with EMail producing/sending.
|
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 |
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 |
mailto:$email
, the email variable would be reevaluated if mail script is executed by a parent query.
mailto:$email?subject=$subject
,it makes possible sending emails to recipients specified by in a row set.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 <user@nosuchhost.com>
</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 <user@nosuchhost.com>
</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 <user@nosuchhost.com>
</connection>
<connection id="db" .../>
<query connection-id="db" >
SELECT * FROM Users
<script connection-id="mail">
#$rownum
Message produced by Scriptella ETL
</script>
</query>
</etl>
Copyright © Copyright 2006-2019 The Scriptella Project Team.