⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 velocityhtmlemail.html

📁 turbine教程
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!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  VelocityHtmlEmail</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>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/VelocityHtmlEmail.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../../../org/apache/turbine/util/velocity/VelocityEmail.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="VelocityHtmlEmail.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_org.apache.turbine.util.mail.HtmlEmail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: &nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<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.velocity</FONT><BR>Class  VelocityHtmlEmail</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.velocity.VelocityHtmlEmail</B></PRE><HR><DL><DT>public class <B>VelocityHtmlEmail</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 Velocity. Essentially, the bodies (text and html) of the email are a Velocity Context objects.  The beauty of this is that you can send email from within your Velocity template or from your business logic in your Java code.  The body of the email is just a Velocity template so you can use all the template functionality of Velocity within your emails! <p>This class allows you to send HTML email with embedded content and/or with attachments.  You can access the VelocityHtmlEmail instance within your templates trough the <code>$mail</code> Velocity variable. <p><code>VelocityHtmlEmail	myEmail= new VelocityHtmlEmail(data);<br>                              context.put("mail", theMessage);</code> <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 TurbineResourceService.setPropertiesFileName() method for more information. <p>This class is basically a conversion of the WebMacroHtmlEmail written by Regis Koenig<P><DL><DT><B>Version: </B><DD>$Id: VelocityHtmlEmail.java,v 1.2 2002/07/11 16:53:19 mpoeschl Exp $</DD><DT><B>Author: </B><DD><a href="mailto:A.Schild@aarboard.ch">Andre Schild</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>&nbsp;<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>&nbsp;<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>&nbsp;<!-- ======== 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/velocity/VelocityHtmlEmail.html#VelocityHtmlEmail(org.apache.turbine.util.RunData)">VelocityHtmlEmail</A></B>(<A HREF="../../../../../org/apache/turbine/util/RunData.html">RunData</A>&nbsp;data)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructor, sets the RunData object.</TD></TR></TABLE>&nbsp;<!-- ========== 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>&nbsp;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/turbine/util/velocity/VelocityHtmlEmail.html#embed(java.lang.String, java.lang.String)">embed</A></B>(java.lang.String&nbsp;surl,      java.lang.String&nbsp;name)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Embed a file in the mail.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/turbine/util/velocity/VelocityHtmlEmail.html#getCid(java.lang.String)">getCid</A></B>(java.lang.String&nbsp;filename)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/turbine/util/velocity/VelocityHtmlEmail.html#send()">send</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Actually send the mail.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../../../org/apache/turbine/util/velocity/VelocityHtmlEmail.html">VelocityHtmlEmail</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/turbine/util/velocity/VelocityHtmlEmail.html#setHtmlTemplate(java.lang.String)">setHtmlTemplate</A></B>(java.lang.String&nbsp;template)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;<A HREF="../../../../../org/apache/turbine/util/velocity/VelocityHtmlEmail.html">VelocityHtmlEmail</A></CODE></FONT></TD>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -