|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
org.apache.taglibs.mailer2.PartTag
org.apache.taglibs.mailer2.MailTag
JSP tag mt:mail is used to construct an e-mail message. It is the root element of this tag library.
mt:mail can have the following child tags:mt:addrecipient, mt:attach, mt:header, mt:part.
The message will be sent unless the var attribute has been set.
| Field Summary | |
static String |
FROM
The name of the context-param to set as the from address. |
static String |
PASSWORD
The name of the context-param to set the plain text password to authenticate to the SMTP server. |
static String |
PORT
The name of the context-param to set the name of the SMTP server port. |
static String |
SERVER
The name of the context-param to set the name of the SMTP server. |
protected String |
username
Username to login to SMTP server. |
static String |
USERNAME
The name of the context-param to set the username to authenticate to the SMTP server. |
static String |
VERSION
Version of this tag library. |
| Fields inherited from class org.apache.taglibs.mailer2.PartTag |
log |
| Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
bodyContent |
| Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
id, pageContext |
| Fields inherited from interface javax.servlet.jsp.tagext.BodyTag |
EVAL_BODY_BUFFERED, EVAL_BODY_TAG |
| Fields inherited from interface javax.servlet.jsp.tagext.IterationTag |
EVAL_BODY_AGAIN |
| Fields inherited from interface javax.servlet.jsp.tagext.Tag |
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
| Constructor Summary | |
MailTag()
Default zero-arg constructor. |
|
| Method Summary | |
void |
addRecipient(String type,
Address address)
Add a recipient to the list of "to" recipients. |
void |
addReplyTo(Address address)
Add an e-mail address to the list of reply-to recipients. |
int |
doAfterBody()
|
int |
doEndTag()
|
int |
doStartTag()
|
String |
getBcc()
Returns the bcc address. |
String |
getCc()
Returns the cc address. |
String |
getFrom()
Returns the from address. |
String |
getImportance()
Returns the importance of the message, either "low", "normal", or "high". |
String |
getMimemessage()
Returns the javax.mail.internet.MimeDataSource object |
String |
getPassword()
Returns the password for SMTP authentication. |
int |
getPort()
Returns the SMTP server port, default 25. |
String |
getReplyto()
Returns the reply-to address. |
String |
getScope()
Returns the scope to store the variable in. |
static int |
getScopeType(String scope)
Returns the scopeType for a given scope name. |
String |
getServer()
Returns the name of the SMTP server. |
String |
getSession()
Returns the javax.mail.Session object. |
Session |
getSessionObject()
Returns a Mail Session object. |
String |
getSubject()
Returns the subject of the message. |
String |
getTo()
Returns the to attribute. |
String |
getUsername()
Returns the username for SMTP authentication. |
String |
getVar()
Returns the name of the variable to store the message in. |
boolean |
isBackground()
Returns whether the mail should be sent in the background. |
void |
release()
|
void |
setBackground(boolean background)
Sets the background attribute. |
void |
setBcc(String bcc)
Sets the bcc attribute. |
void |
setCc(String cc)
Sets the cc attribute. |
void |
setFrom(String from)
Sets the from attribute. |
void |
setImportance(String importance)
Sets the importance of the message. |
void |
setMimemessage(String mimemessage)
Sets the mimemessage attribute. |
void |
setPassword(String password)
Sets the password for PLAIN or LOGIN SMTP authentication. |
void |
setPort(int port)
Sets the TCP/IP server port, default 25. |
void |
setReplyto(String replyto)
Sets the Reply-To address for this message. |
void |
setScope(String scope)
Sets the scope where this message should be stored, rather than sent. |
void |
setServer(String server)
Sets the SMTP server name. |
void |
setSession(String session)
Sets the JNDI lookup for a javax.mail.Session object to be used as the mail Session. |
void |
setSubject(String subject)
Sets the subject for this message. |
void |
setTo(String to)
Sets the "to" recipients for this message. |
void |
setUsername(String username)
Set the login username name for PLAIN or LOGIN SMTP authentication. |
void |
setVar(String var)
Sets the var attribute. |
| Methods inherited from class org.apache.taglibs.mailer2.PartTag |
addPart, constructMessage, getBody, getContentType, getEncoding, getHeaders, getParts, getType, setBody, setEncoding, setHeader, setType |
| Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
doInitBody, getBodyContent, getPreviousOut, setBodyContent |
| Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, resetCustomAttributes, setId, setPageContext, setParent, setValue |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.servlet.jsp.tagext.Tag |
getParent, setPageContext, setParent |
| Field Detail |
public static final String FROM
public static final String SERVER
public static final String PORT
public static final String USERNAME
public static final String PASSWORD
public static final String VERSION
protected String username
| Constructor Detail |
public MailTag()
| Method Detail |
public int doStartTag()
throws JspException
doStartTag in interface TagdoStartTag in class PartTagJspException
public int doAfterBody()
throws JspException
doAfterBody in interface BodyTagdoAfterBody in class PartTagJspException
public int doEndTag()
throws JspException
doEndTag in interface TagdoEndTag in class PartTagJspExceptionpublic void release()
release in interface Tagrelease in class PartTag
public void addRecipient(String type,
Address address)
throws JspException
type - The type of recipient, either "to", "cc", or "bcc"address - The address to add
JspException - for invalid typespublic void addReplyTo(Address address)
address - The e-mail address to reply-to
public static int getScopeType(String scope)
throws JspException
scope - "request", "page", "session", or "application"
JspException - For an invalid scope
public Session getSessionObject()
throws JspException
JspException - Upon errorpublic String getBcc()
public void setBcc(String bcc)
bcc - The e-mail address that will get a BCC of this messagepublic String getCc()
public void setCc(String cc)
cc - The e-mail address that will get a CC of this messagepublic String getFrom()
public void setFrom(String from)
from - The e-mail address of the sender of this messagepublic String getImportance()
public void setImportance(String importance)
importance - Either "low", "normal", or "high"public String getMimemessage()
public void setMimemessage(String mimemessage)
mimemessage - The name of a JNDI lookup MimePartDataSourcepublic String getPassword()
public void setPassword(String password)
password - Plain text password for authenticationpublic int getPort()
public void setPort(int port)
port - The port numberpublic String getReplyto()
public void setReplyto(String replyto)
replyto - The address of the person to whom this message should be repliedpublic String getScope()
public void setScope(String scope)
scope - The name of the scope, either "page", "request", "session", or "application".public String getServer()
public void setServer(String server)
server - Name of the mail server, default "localhost".public String getSession()
public void setSession(String session)
session - Name of the JNDI lookuppublic String getSubject()
public void setSubject(String subject)
subject - The subject for this messagepublic String getTo()
public void setTo(String to)
to - The e-mail address for this recipientpublic String getUsername()
public void setUsername(String username)
username - The usernamepublic String getVar()
public void setVar(String var)
setScope(java.lang.String).
var - The name of the variablepublic boolean isBackground()
public void setBackground(boolean background)
background - True when the message will be sent in a separate thread
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||