JSP taglib encapsulating the JavaMail API.
This is the legacy implementation for compatibility with applications that use JSP scriptlets. When JSP scriptlets are not required, please use NMW Email Taglib Reference.
Both implementations are interoperable and may be used simultaneously under different prefixes.
The structure of the tags matches that of the underlying JavaMail API with the following mapping:
- <email:email> ⟶ Message
- <email:to> ⟶ Message.addRecipient(…)
- <email:from> ⟶ Message.setFrom(…)
- <email:subject> ⟶ Message.setSubject(…)
- <email:multipart> ⟶ Multipart
- <email:bodypart> ⟶ BodyPart
-
<email:header>
⟶ Part.addHeader(…)
or Part.setHeader(…)
-
<email:contentId>
⟶ Sets the
Content-ID:
header while trimming the body and surrounding with<…>
.
-
<email:contentId>
⟶ Sets the
- <email:content> ⟶ Part.setContent(…)
- <email:file> ⟶ Part.setDataHandler(…)
- <email:data> ⟶ Part.setDataHandler(…)
The nesting allowed is:
- <email:email>
- + <email:to>
- ! <email:from>
- ! <email:subject>
- * <email:header>
- ? <email:contentId>
- ! Exactly one of:
- ! <email:content>
- ! <email:file>
- ! <email:data>
- ! <email:multipart>
- + <email:bodypart>
- * <email:header>
- ? <email:contentId>
- ! Exactly one of:
- ! <email:content>
- ! <email:file>
- ! <email:data>
- ! <email:multipart>
- + …
- + <email:bodypart>
* indicates zero or more uses allowed
? indicates zero or one use allowed
+ indicates one or more uses required
! indicates exactly one use required
This taglib is part of an extensible suite of interoperable, context-aware, auto-encoding taglibs. All auto-encoding tags generate correct output for their context, provide context information for nested tags, and validate the output of nested tags. For example, <ao:message> within <email:subject> will write its output encoded as TEXT, while within <email:content> (of type "text/html") will write its output encoded as XHTML.
This suite includes, but is not limited to:
- AO Encoding Taglib
- AO Taglib
- AOWeb Struts Skin Taglib
- NMW Email Taglib (this taglib)
- NMW Payment Taglib
Usage
Standard Syntax
<%@ taglib prefix="email" uri="https://oss.newmediaworks.com/email-taglib/legacy" %>
XML Syntax
<anyxmlelement xmlns:email="https://oss.newmediaworks.com/email-taglib/legacy" />
Tag Library Information
Display Name: | NMW Email Taglib (Legacy) |
---|---|
Version: | 2.1.2 |
Short Name: | |
URI: | https://oss.newmediaworks.com/email-taglib/legacy |