📄 webmacrohtmlemail.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Fri Dec 06 19:57:10 CET 2002 --><TITLE>jakarta-turbine-2 2.2 API: Class WebMacroHtmlEmail</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/WebMacroHtmlEmail.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../org/apache/turbine/util/webmacro/WebMacroFormatter.WebMacroAlternator.html"><B>PREV CLASS</B></A> NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="WebMacroHtmlEmail.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | <A HREF="#fields_inherited_from_class_org.apache.turbine.util.mail.HtmlEmail">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">org.apache.turbine.util.webmacro</FONT><BR>Class WebMacroHtmlEmail</H2><PRE>java.lang.Object | +--<A HREF="../../../../../org/apache/turbine/util/mail/Email.html">org.apache.turbine.util.mail.Email</A> | +--<A HREF="../../../../../org/apache/turbine/util/mail/MultiPartEmail.html">org.apache.turbine.util.mail.MultiPartEmail</A> | +--<A HREF="../../../../../org/apache/turbine/util/mail/HtmlEmail.html">org.apache.turbine.util.mail.HtmlEmail</A> | +--<B>org.apache.turbine.util.webmacro.WebMacroHtmlEmail</B></PRE><HR><B>Deprecated.</B> <I>you should use velocity</I><P><DL><DT>public class <B>WebMacroHtmlEmail</B><DT>extends <A HREF="../../../../../org/apache/turbine/util/mail/HtmlEmail.html">HtmlEmail</A></DL><P>This is a simple class for sending html email from within WebMacro. Essentially, the bodies (text and html) of the email are a WebMacro Context objects. The beauty of this is that you can send email from within your WebMacro template or from your business logic in your Java code. The body of the email is just a WebMacro template so you can use all the template functionality of WebMacro within your emails! <p>This class allows you to send HTML email with embedded content and/or with attachments. You can access the WebMacroHtmlEmail instance within your templates trough the <code>$mail</code> WebMacro variable. <p>The templates should be located under your Template turbine directory. <p>This class extends the HtmlEmail class. Thus, it uses the JavaMail API and also depends on having the mail.server property set in the TurbineResources.properties file. If you want to use this class outside of Turbine for general processing that is also possible by making sure to set the path to the TurbineResources.properties. See the TurbineConfig class for more information.<P><DL><DT><B>Version: </B><DD>$Id: WebMacroHtmlEmail.java,v 1.2 2002/07/11 16:53:19 mpoeschl Exp $</DD><DT><B>Author: </B><DD><a href="mailto:unknown">Regis Koenig</a>, <a href="mailto:jon@latchkey.com">Jon S. Stevens</a></DD></DL><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><A NAME="fields_inherited_from_class_org.apache.turbine.util.mail.HtmlEmail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Fields inherited from class org.apache.turbine.util.mail.<A HREF="../../../../../org/apache/turbine/util/mail/HtmlEmail.html">HtmlEmail</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../../../org/apache/turbine/util/mail/HtmlEmail.html#html">html</A>, <A HREF="../../../../../org/apache/turbine/util/mail/HtmlEmail.html#htmlContent">htmlContent</A>, <A HREF="../../../../../org/apache/turbine/util/mail/HtmlEmail.html#text">text</A></CODE></TD></TR></TABLE> <A NAME="fields_inherited_from_class_org.apache.turbine.util.mail.MultiPartEmail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Fields inherited from class org.apache.turbine.util.mail.<A HREF="../../../../../org/apache/turbine/util/mail/MultiPartEmail.html">MultiPartEmail</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../../../org/apache/turbine/util/mail/MultiPartEmail.html#emailBody">emailBody</A>, <A HREF="../../../../../org/apache/turbine/util/mail/MultiPartEmail.html#main">main</A></CODE></TD></TR></TABLE> <A NAME="fields_inherited_from_class_org.apache.turbine.util.mail.Email"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Fields inherited from class org.apache.turbine.util.mail.<A HREF="../../../../../org/apache/turbine/util/mail/Email.html">Email</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../../../org/apache/turbine/util/mail/Email.html#ATTACHMENTS">ATTACHMENTS</A>, <A HREF="../../../../../org/apache/turbine/util/mail/Email.html#charset">charset</A>, <A HREF="../../../../../org/apache/turbine/util/mail/Email.html#CONTENT_TYPE">CONTENT_TYPE</A>, <A HREF="../../../../../org/apache/turbine/util/mail/Email.html#EMAIL_BODY">EMAIL_BODY</A>, <A HREF="../../../../../org/apache/turbine/util/mail/Email.html#EMAIL_SUBJECT">EMAIL_SUBJECT</A>, <A HREF="../../../../../org/apache/turbine/util/mail/Email.html#FILE_SERVER">FILE_SERVER</A>, <A HREF="../../../../../org/apache/turbine/util/mail/Email.html#ISO_8859_1">ISO_8859_1</A>, <A HREF="../../../../../org/apache/turbine/util/mail/Email.html#KOI8_R">KOI8_R</A>, <A HREF="../../../../../org/apache/turbine/util/mail/Email.html#MAIL_HOST">MAIL_HOST</A>, <A HREF="../../../../../org/apache/turbine/util/mail/Email.html#MAIL_SERVER">MAIL_SERVER</A>, <A HREF="../../../../../org/apache/turbine/util/mail/Email.html#MAIL_SMTP_FROM">MAIL_SMTP_FROM</A>, <A HREF="../../../../../org/apache/turbine/util/mail/Email.html#MAIL_TRANSPORT_PROTOCOL">MAIL_TRANSPORT_PROTOCOL</A>, <A HREF="../../../../../org/apache/turbine/util/mail/Email.html#message">message</A>, <A HREF="../../../../../org/apache/turbine/util/mail/Email.html#RECEIVER_EMAIL">RECEIVER_EMAIL</A>, <A HREF="../../../../../org/apache/turbine/util/mail/Email.html#RECEIVER_NAME">RECEIVER_NAME</A>, <A HREF="../../../../../org/apache/turbine/util/mail/Email.html#SENDER_EMAIL">SENDER_EMAIL</A>, <A HREF="../../../../../org/apache/turbine/util/mail/Email.html#SENDER_NAME">SENDER_NAME</A>, <A HREF="../../../../../org/apache/turbine/util/mail/Email.html#SMTP">SMTP</A>, <A HREF="../../../../../org/apache/turbine/util/mail/Email.html#TEXT_HTML">TEXT_HTML</A>, <A HREF="../../../../../org/apache/turbine/util/mail/Email.html#TEXT_PLAIN">TEXT_PLAIN</A>, <A HREF="../../../../../org/apache/turbine/util/mail/Email.html#US_ASCII">US_ASCII</A></CODE></TD></TR></TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../../../org/apache/turbine/util/webmacro/WebMacroHtmlEmail.html#WebMacroHtmlEmail()">WebMacroHtmlEmail</A></B>()</CODE><BR> <B>Deprecated.</B> Constructor, sets the RunData object.</TD></TR></TABLE> <!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/turbine/util/webmacro/WebMacroHtmlEmail.html#embed(java.lang.String, java.lang.String)">embed</A></B>(java.lang.String surl, java.lang.String name)</CODE><BR> <B>Deprecated.</B> Embed a file in the mail.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/turbine/util/webmacro/WebMacroHtmlEmail.html#getCid(java.lang.String)">getCid</A></B>(java.lang.String filename)</CODE><BR> <B>Deprecated.</B> Get the cid of an embedded file.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> org.webmacro.servlet.WebContext</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/turbine/util/webmacro/WebMacroHtmlEmail.html#getContext()">getContext</A></B>()</CODE><BR> <B>Deprecated.</B> Get the context object that will be merged with the template.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/turbine/util/webmacro/WebMacroHtmlEmail.html#send()">send</A></B>()</CODE><BR> <B>Deprecated.</B> Actually send the mail.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../../org/apache/turbine/util/webmacro/WebMacroHtmlEmail.html">WebMacroHtmlEmail</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/turbine/util/webmacro/WebMacroHtmlEmail.html#setContext(org.webmacro.servlet.WebContext)">setContext</A></B>(org.webmacro.servlet.WebContext context)</CODE><BR> <B>Deprecated.</B> Set the context object that will be merged with the template.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../../org/apache/turbine/util/webmacro/WebMacroHtmlEmail.html">WebMacroHtmlEmail</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/turbine/util/webmacro/WebMacroHtmlEmail.html#setHtmlTemplate(java.lang.String)">setHtmlTemplate</A></B>(java.lang.String template)</CODE><BR> <B>Deprecated.</B> Set the HTML template for the mail.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../../org/apache/turbine/util/webmacro/WebMacroHtmlEmail.html">WebMacroHtmlEmail</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/turbine/util/webmacro/WebMacroHtmlEmail.html#setTextTemplate(java.lang.String)">setTextTemplate</A></B>(java.lang.String template)</CODE><BR> <B>Deprecated.</B> Set the text template for the mail.</TD></TR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -