debug | Turn detailed debug messages on. |
files | A list of attachment files. |
from | The from address. |
host | The host name of the server. |
message | The message body as text. |
name | The name of the job. |
password | The Password for authentication. |
port | The port of the server. |
ssl | Use SSL for communication with the mail host. |
subject | The subject. |
to | The to addresses. |
username | The Username for authentication. |
Example 1 | Send a simple message. |
Example 2 | Send attachements. |
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | No. |
Turn detailed debug messages on.
Configured By | ELEMENT |
Access | READ_WRITE |
Required | No. |
A list of attachment files.
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | Yes. |
The from address.
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | Yes. |
The host name of the server.
Configured By | TEXT |
Access | READ_WRITE |
Required | No. |
The message body as text.
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | No. |
The name of the job. Any text.
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | No. |
The Password for authentication.
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | Yes. |
The port of the server.
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | No. |
Use SSL for communication with the mail host.
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | No. Defaults to (no subject). |
The subject.
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | Yes. |
The to addresses. A semicolon delimited list.
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | No. |
The Username for authentication.
Send a simple message.
<oddjob xmlns:mail="http://rgordon.co.uk/oddjob/mail"> <job> <mail:send name="Send alert mail" from="${my.alert.from}" to="${my.alert.to}" port="${my.mail.port}" host="${my.mail.host}" username="${my.mail.username}" password="${my.mail.password}" subject="Something Important" debug="true" ssl="${my.mail.ssl}"> Something Important has happened! </mail:send> </job> </oddjob>
Send attachements. This example rather unimagineatively sends the build file as two seperate attachements.
<oddjob id="oddjob"> <job> <mail:send from="${my.alert.from}" host="${my.mail.host}" name="Send Attachments" password="${my.mail.password}" port="${my.mail.port}" ssl="true" subject="Some Attachements" to="${my.alert.to}" username="${my.mail.username}" xmlns:mail="http://rgordon.co.uk/oddjob/mail"> <files> <list> <values> <file file="${oddjob.dir}/about.txt"/> <file file="${oddjob.dir}/logo.png"/> </values> </list> </files> Check out these attachements! </mail:send> </job> </oddjob>