sunlabs.brazil.handler
public class SMTPHandler extends Template implements Handler
<param>
tags (see below).
[prefix].error
will contain the
error message.
There are 2 ways of using the sendmail
template:
param
tag adds an additional header
to the email message. There may be multiple headers of the same
name
, and their order is preserved.
When a singleton tag is used,
the To:
header is filled in to match the actual
recipients.
If you need to specify cc
, bcc
, or other
mail headers use param
tags.
Note:
The to
attribute, which is required,
specifies the actual recipients. When to
is specified
as part of a param
tag, it is the recipient list presented
to the email recipient, which may have nothing to do wih the actual
recipients. In the singleton case, they are made the same.
Query parameters:
Version: @(#)SMTPHandler.java 2.9
Method Summary | |
---|---|
boolean | done(RewriteContext hr)
If we run off the end of the page, but there is email pending
to be sent, send it anyway. |
boolean | init(Server server, String prefix) |
boolean | init(RewriteContext hr) |
boolean | respond(Request request) |
static void | smtp(String fromHost, String smtpHost, String from, String to, String body, StringMap headers)
Send an email message via smtp - simple version. |
static void | smtp(String fromHost, String smtpHost, String from, String to, String body, StringMap headers, Server server) |
void | tag_param(RewriteContext hr)
Add an additional email header.
|
void | tag_sendmail(RewriteContext hr)
set-up an email message for sending. |
void | tag_slash_sendmail(RewriteContext hr)
If we haven't sent the mail yet - send it. |
Parameters: fromHost the hostname of the sender (may be null) smtpHost the SMTP host (whose smtp daemon to contact) from who the email is from to a space delimited list of recepients body The message body headers message headers (may be null)
Throws: IOException, if any errors occured (yuk) Either the headers Or body may be null, but not both.
look for: <param name="..." value="...>.
Which will add the email header: name: value
.
The name "body" is special, and will cause the email body to be replaced.