The Sendmail action class sends email. Action supports following
parameters:
smtp-host
The smtp server to send the mail through. If not specified,
default from cocoon.xconf will be used.
smtp-user
The smtp user. If smtp-user and smtp-host not specified,
default from cocoon.xconf will be used.
smtp-password
The smtp user's password. If smtp-user and smtp-host not
specified, default from cocoon.xconf will be used.
from
the email address the mail appears to be from
to
the email address(es) the mail it sent to. This can
be multiple addresses separated with commas.
replyTo
the email address(es) replies should be sent to. This can
be multiple addresses separated with commas.
cc
an email address(es) of someone, who should receive a
carbon copy. This can also be a list of multiple addresses
separated by commas.
bcc
an email address(es) of someone, who should receive a black
carbon copy. This can also be a list of multiple addresses
separated by commas.
subject
the subject line of the email
src
A url specifying the source of the text body of the email
srcMimeType
The optional Mime Type of the source of the text body of the email
if you specified src
body
the text body of the email, if src is specified, body will be ignored
charset
the character set, which should be used the encode the body text.
This parameter is only used, if no attachements are send.
attachments
One or more attachments, separated by whitespace, which should be
attached to the email message. If the argument contains a ':', it is
assumed, that the argument describes a
org.apache.excalibur.source.Source object. Otherwise, it
is assumed, that the argument describes a request parameter of an
uploaded file, which Cocoon has internally turned into a
Part
object.
Minimally, from, to, body parameters
should be specified. Rest of parameters are optional.
The class loads all of these parameters from the sitemap, except the
attachements, which may come from file upload request parameters.
Note it's strongly recommended that the to, cc and bcc addresses be
specified by the sitemap, not the request, to prevent possible abuse of the
SendmailAction as a spam source.
One or two parameters are returned to the sitemap depending on the outcome
of sending the message: status and message.
If the email message could be successfully delivered only the parameter
status with the value success is returned.
If there was a problem sending the message, status can have
the value user-error and the message
parameter is set to an explainatory text. This usually indicates problems with
one or more email addresses. Other problems lead to a value of
server-error for status and
message contains a corresponding message.
act(Redirector redirector,
SourceResolver resolver,
Map objectModel,
String source,
Parameters parameters)
Controls the processing against some values of the
Dictionary objectModel and returns a
Map object with values used in subsequent
sitemap substitution patterns.
Controls the processing against some values of the
Dictionary objectModel and returns a
Map object with values used in subsequent
sitemap substitution patterns.
NOTE: This interface is designed so that implentations can be ThreadSafe.
When an action is ThreadSafe, only one instance serves all requests : this
reduces memory usage and avoids pooling.
objectModel - The Map with object of the
calling environment which can be used
to select values this controller may need
(ie Request, Response).
source - A source String to the Action
parameters - The Parameters for this invocation
Returns:
Map The returned Map object with
sitemap substitution values which can be used
in subsequent elements attributes like src=
using a xpath like expression: src="mydir/{myval}/foo"
If the return value is null the processing inside
the element of the sitemap will
be skipped.