source: other-projects/trunk/gs3-release-maker/apache-ant-1.6.5/build/javadocs/org/apache/tools/mail/MailMessage.html@ 14627

Last change on this file since 14627 was 14627, checked in by oranfry, 17 years ago

initial import of the gs3-release-maker

File size: 22.7 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<!--NewPage-->
3<HTML>
4<HEAD>
5<!-- Generated by javadoc (build 1.4.2_13) on Mon Oct 01 14:33:35 NZST 2007 -->
6<TITLE>
7MailMessage (Apache Ant API)
8</TITLE>
9
10<META NAME="keywords" CONTENT="org.apache.tools.mail.MailMessage class">
11
12<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
13
14<SCRIPT type="text/javascript">
15function windowTitle()
16{
17 parent.document.title="MailMessage (Apache Ant API)";
18}
19</SCRIPT>
20
21</HEAD>
22
23<BODY BGCOLOR="white" onload="windowTitle();">
24
25
26<!-- ========= START OF TOP NAVBAR ======= -->
27<A NAME="navbar_top"><!-- --></A>
28<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
29<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
30<TR>
31<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
32<A NAME="navbar_top_firstrow"><!-- --></A>
33<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
34 <TR ALIGN="center" VALIGN="top">
35 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
36 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
37 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
38 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
39 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
40 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
41 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
42 </TR>
43</TABLE>
44</TD>
45<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
46</EM>
47</TD>
48</TR>
49
50<TR>
51<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
52&nbsp;PREV CLASS&nbsp;
53&nbsp;<A HREF="../../../../org/apache/tools/mail/SmtpResponseReader.html" title="class in org.apache.tools.mail"><B>NEXT CLASS</B></A></FONT></TD>
54<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
55 <A HREF="../../../../index.html" target="_top"><B>FRAMES</B></A> &nbsp;
56&nbsp;<A HREF="MailMessage.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
57&nbsp;<SCRIPT type="text/javascript">
58 <!--
59 if(window==top) {
60 document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
61 }
62 //-->
63</SCRIPT>
64<NOSCRIPT>
65 <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
66</NOSCRIPT>
67
68</FONT></TD>
69</TR>
70<TR>
71<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
72 SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
73<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
74DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
75</TR>
76</TABLE>
77<A NAME="skip-navbar_top"></A>
78<!-- ========= END OF TOP NAVBAR ========= -->
79
80<HR>
81<!-- ======== START OF CLASS DATA ======== -->
82<H2>
83<FONT SIZE="-1">
84org.apache.tools.mail</FONT>
85<BR>
86Class MailMessage</H2>
87<PRE>
88java.lang.Object
89 <IMG SRC="../../../../resources/inherit.gif" ALT="extended by"><B>org.apache.tools.mail.MailMessage</B>
90</PRE>
91<HR>
92<DL>
93<DT>public class <B>MailMessage</B><DT>extends java.lang.Object</DL>
94
95<P>
96A class to help send SMTP email.
97 This class is an improvement on the sun.net.smtp.SmtpClient class
98 found in the JDK. This version has extra functionality, and can be used
99 with JVMs that did not extend from the JDK. It's not as robust as
100 the JavaMail Standard Extension classes, but it's easier to use and
101 easier to install, and has an Open Source license.
102 <p>
103 It can be used like this:
104 <blockquote><pre>
105 String mailhost = "localhost"; // or another mail host
106 String from = "Mail Message Servlet &lt;[email protected]&gt;";
107 String to = "[email protected]";
108 String cc1 = "[email protected]";
109 String cc2 = "[email protected]";
110 String bcc = "[email protected]";
111 &nbsp;
112 MailMessage msg = new MailMessage(mailhost);
113 msg.setPort(25);
114 msg.from(from);
115 msg.to(to);
116 msg.cc(cc1);
117 msg.cc(cc2);
118 msg.bcc(bcc);
119 msg.setSubject("Test subject");
120 PrintStream out = msg.getPrintStream();
121 &nbsp;
122 Enumeration enum = req.getParameterNames();
123 while (enum.hasMoreElements()) {
124 String name = (String)enum.nextElement();
125 String value = req.getParameter(name);
126 out.println(name + " = " + value);
127 }
128 &nbsp;
129 msg.sendAndClose();
130 </pre></blockquote>
131 <p>
132 Be sure to set the from address, then set the recepient
133 addresses, then set the subject and other headers, then get the
134 PrintStream, then write the message, and finally send and close.
135 The class does minimal error checking internally; it counts on the mail
136 host to complain if there's any malformatted input or out of order
137 execution.
138 <p>
139 An attachment mechanism based on RFC 1521 could be implemented on top of
140 this class. In the meanwhile, JavaMail is the best solution for sending
141 email with attachments.
142 <p>
143 Still to do:
144 <ul>
145 <li>Figure out how to close the connection in case of error
146 </ul>
147<P>
148
149<P>
150<DL>
151<DT><B>Version:</B></DT>
152 <DD>1.1, 2000/03/19, added angle brackets to address, helps some servers
153 version 1.0, 1999/12/29</DD>
154</DL>
155<HR>
156
157<P>
158<!-- ======== NESTED CLASS SUMMARY ======== -->
159
160
161<!-- =========== FIELD SUMMARY =========== -->
162
163<A NAME="field_summary"><!-- --></A>
164<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
165<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
166<TD COLSPAN=2><FONT SIZE="+2">
167<B>Field Summary</B></FONT></TD>
168</TR>
169<TR BGCOLOR="white" CLASS="TableRowColor">
170<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
171<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
172<TD><CODE><B><A HREF="../../../../org/apache/tools/mail/MailMessage.html#DEFAULT_HOST">DEFAULT_HOST</A></B></CODE>
173
174<BR>
175&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;default mailhost</TD>
176</TR>
177<TR BGCOLOR="white" CLASS="TableRowColor">
178<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
179<CODE>static&nbsp;int</CODE></FONT></TD>
180<TD><CODE><B><A HREF="../../../../org/apache/tools/mail/MailMessage.html#DEFAULT_PORT">DEFAULT_PORT</A></B></CODE>
181
182<BR>
183&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;default port for SMTP: 25</TD>
184</TR>
185</TABLE>
186&nbsp;
187<!-- ======== CONSTRUCTOR SUMMARY ======== -->
188
189<A NAME="constructor_summary"><!-- --></A>
190<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
191<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
192<TD COLSPAN=2><FONT SIZE="+2">
193<B>Constructor Summary</B></FONT></TD>
194</TR>
195<TR BGCOLOR="white" CLASS="TableRowColor">
196<TD><CODE><B><A HREF="../../../../org/apache/tools/mail/MailMessage.html#MailMessage()">MailMessage</A></B>()</CODE>
197
198<BR>
199&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a new MailMessage to send an email.</TD>
200</TR>
201<TR BGCOLOR="white" CLASS="TableRowColor">
202<TD><CODE><B><A HREF="../../../../org/apache/tools/mail/MailMessage.html#MailMessage(java.lang.String)">MailMessage</A></B>(java.lang.String&nbsp;host)</CODE>
203
204<BR>
205&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a new MailMessage to send an email.</TD>
206</TR>
207<TR BGCOLOR="white" CLASS="TableRowColor">
208<TD><CODE><B><A HREF="../../../../org/apache/tools/mail/MailMessage.html#MailMessage(java.lang.String, int)">MailMessage</A></B>(java.lang.String&nbsp;host,
209 int&nbsp;port)</CODE>
210
211<BR>
212&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a new MailMessage to send an email.</TD>
213</TR>
214</TABLE>
215&nbsp;
216<!-- ========== METHOD SUMMARY =========== -->
217
218<A NAME="method_summary"><!-- --></A>
219<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
220<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
221<TD COLSPAN=2><FONT SIZE="+2">
222<B>Method Summary</B></FONT></TD>
223</TR>
224<TR BGCOLOR="white" CLASS="TableRowColor">
225<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
226<CODE>&nbsp;void</CODE></FONT></TD>
227<TD><CODE><B><A HREF="../../../../org/apache/tools/mail/MailMessage.html#bcc(java.lang.String)">bcc</A></B>(java.lang.String&nbsp;bcc)</CODE>
228
229<BR>
230&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the bcc address.</TD>
231</TR>
232<TR BGCOLOR="white" CLASS="TableRowColor">
233<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
234<CODE>&nbsp;void</CODE></FONT></TD>
235<TD><CODE><B><A HREF="../../../../org/apache/tools/mail/MailMessage.html#cc(java.lang.String)">cc</A></B>(java.lang.String&nbsp;cc)</CODE>
236
237<BR>
238&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the cc address.</TD>
239</TR>
240<TR BGCOLOR="white" CLASS="TableRowColor">
241<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
242<CODE>&nbsp;void</CODE></FONT></TD>
243<TD><CODE><B><A HREF="../../../../org/apache/tools/mail/MailMessage.html#from(java.lang.String)">from</A></B>(java.lang.String&nbsp;from)</CODE>
244
245<BR>
246&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the from address.</TD>
247</TR>
248<TR BGCOLOR="white" CLASS="TableRowColor">
249<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
250<CODE>&nbsp;java.io.PrintStream</CODE></FONT></TD>
251<TD><CODE><B><A HREF="../../../../org/apache/tools/mail/MailMessage.html#getPrintStream()">getPrintStream</A></B>()</CODE>
252
253<BR>
254&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a PrintStream that can be used to write the body of the message.</TD>
255</TR>
256<TR BGCOLOR="white" CLASS="TableRowColor">
257<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
258<CODE>&nbsp;void</CODE></FONT></TD>
259<TD><CODE><B><A HREF="../../../../org/apache/tools/mail/MailMessage.html#replyto(java.lang.String)">replyto</A></B>(java.lang.String&nbsp;rto)</CODE>
260
261<BR>
262&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the replyto address
263 This method may be
264 called multiple times.</TD>
265</TR>
266<TR BGCOLOR="white" CLASS="TableRowColor">
267<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
268<CODE>&nbsp;void</CODE></FONT></TD>
269<TD><CODE><B><A HREF="../../../../org/apache/tools/mail/MailMessage.html#sendAndClose()">sendAndClose</A></B>()</CODE>
270
271<BR>
272&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sends the message and closes the connection to the server.</TD>
273</TR>
274<TR BGCOLOR="white" CLASS="TableRowColor">
275<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
276<CODE>&nbsp;void</CODE></FONT></TD>
277<TD><CODE><B><A HREF="../../../../org/apache/tools/mail/MailMessage.html#setHeader(java.lang.String, java.lang.String)">setHeader</A></B>(java.lang.String&nbsp;name,
278 java.lang.String&nbsp;value)</CODE>
279
280<BR>
281&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the named header to the given value.</TD>
282</TR>
283<TR BGCOLOR="white" CLASS="TableRowColor">
284<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
285<CODE>&nbsp;void</CODE></FONT></TD>
286<TD><CODE><B><A HREF="../../../../org/apache/tools/mail/MailMessage.html#setPort(int)">setPort</A></B>(int&nbsp;port)</CODE>
287
288<BR>
289&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the port to connect to the SMTP host.</TD>
290</TR>
291<TR BGCOLOR="white" CLASS="TableRowColor">
292<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
293<CODE>&nbsp;void</CODE></FONT></TD>
294<TD><CODE><B><A HREF="../../../../org/apache/tools/mail/MailMessage.html#setSubject(java.lang.String)">setSubject</A></B>(java.lang.String&nbsp;subj)</CODE>
295
296<BR>
297&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the subject of the mail message.</TD>
298</TR>
299<TR BGCOLOR="white" CLASS="TableRowColor">
300<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
301<CODE>&nbsp;void</CODE></FONT></TD>
302<TD><CODE><B><A HREF="../../../../org/apache/tools/mail/MailMessage.html#to(java.lang.String)">to</A></B>(java.lang.String&nbsp;to)</CODE>
303
304<BR>
305&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the to address.</TD>
306</TR>
307</TABLE>
308&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
309<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
310<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
311<TD><B>Methods inherited from class java.lang.Object</B></TD>
312</TR>
313<TR BGCOLOR="white" CLASS="TableRowColor">
314<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
315</TR>
316</TABLE>
317&nbsp;
318<P>
319
320<!-- ============ FIELD DETAIL =========== -->
321
322<A NAME="field_detail"><!-- --></A>
323<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
324<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
325<TD COLSPAN=1><FONT SIZE="+2">
326<B>Field Detail</B></FONT></TD>
327</TR>
328</TABLE>
329
330<A NAME="DEFAULT_HOST"><!-- --></A><H3>
331DEFAULT_HOST</H3>
332<PRE>
333public static final java.lang.String <B>DEFAULT_HOST</B></PRE>
334<DL>
335<DD>default mailhost
336<P>
337<DL>
338<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.apache.tools.mail.MailMessage.DEFAULT_HOST">Constant Field Values</A></DL>
339</DL>
340<HR>
341
342<A NAME="DEFAULT_PORT"><!-- --></A><H3>
343DEFAULT_PORT</H3>
344<PRE>
345public static final int <B>DEFAULT_PORT</B></PRE>
346<DL>
347<DD>default port for SMTP: 25
348<P>
349<DL>
350<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.apache.tools.mail.MailMessage.DEFAULT_PORT">Constant Field Values</A></DL>
351</DL>
352
353<!-- ========= CONSTRUCTOR DETAIL ======== -->
354
355<A NAME="constructor_detail"><!-- --></A>
356<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
357<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
358<TD COLSPAN=1><FONT SIZE="+2">
359<B>Constructor Detail</B></FONT></TD>
360</TR>
361</TABLE>
362
363<A NAME="MailMessage()"><!-- --></A><H3>
364MailMessage</H3>
365<PRE>
366public <B>MailMessage</B>()
367 throws java.io.IOException</PRE>
368<DL>
369<DD>Constructs a new MailMessage to send an email.
370 Use localhost as the mail server with port 25.
371<P>
372
373<DT><B>Throws:</B>
374<DD><CODE>java.io.IOException</CODE> - if there's any problem contacting the mail server</DL>
375<HR>
376
377<A NAME="MailMessage(java.lang.String)"><!-- --></A><H3>
378MailMessage</H3>
379<PRE>
380public <B>MailMessage</B>(java.lang.String&nbsp;host)
381 throws java.io.IOException</PRE>
382<DL>
383<DD>Constructs a new MailMessage to send an email.
384 Use the given host as the mail server with port 25.
385<P>
386<DT><B>Parameters:</B><DD><CODE>host</CODE> - the mail server to use
387<DT><B>Throws:</B>
388<DD><CODE>java.io.IOException</CODE> - if there's any problem contacting the mail server</DL>
389<HR>
390
391<A NAME="MailMessage(java.lang.String, int)"><!-- --></A><H3>
392MailMessage</H3>
393<PRE>
394public <B>MailMessage</B>(java.lang.String&nbsp;host,
395 int&nbsp;port)
396 throws java.io.IOException</PRE>
397<DL>
398<DD>Constructs a new MailMessage to send an email.
399 Use the given host and port as the mail server.
400<P>
401<DT><B>Parameters:</B><DD><CODE>host</CODE> - the mail server to use<DD><CODE>port</CODE> - the port to connect to
402<DT><B>Throws:</B>
403<DD><CODE>java.io.IOException</CODE> - if there's any problem contacting the mail server</DL>
404
405<!-- ============ METHOD DETAIL ========== -->
406
407<A NAME="method_detail"><!-- --></A>
408<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
409<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
410<TD COLSPAN=1><FONT SIZE="+2">
411<B>Method Detail</B></FONT></TD>
412</TR>
413</TABLE>
414
415<A NAME="setPort(int)"><!-- --></A><H3>
416setPort</H3>
417<PRE>
418public void <B>setPort</B>(int&nbsp;port)</PRE>
419<DL>
420<DD>Set the port to connect to the SMTP host.
421<P>
422<DD><DL>
423<DT><B>Parameters:</B><DD><CODE>port</CODE> - the port to use for connection.<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/tools/mail/MailMessage.html#DEFAULT_PORT"><CODE>DEFAULT_PORT</CODE></A></DL>
424</DD>
425</DL>
426<HR>
427
428<A NAME="from(java.lang.String)"><!-- --></A><H3>
429from</H3>
430<PRE>
431public void <B>from</B>(java.lang.String&nbsp;from)
432 throws java.io.IOException</PRE>
433<DL>
434<DD>Sets the from address. Also sets the "From" header. This method should
435 be called only once.
436<P>
437<DD><DL>
438<DT><B>Parameters:</B><DD><CODE>from</CODE> - the from address
439<DT><B>Throws:</B>
440<DD><CODE>java.io.IOException</CODE> - if there's any problem reported by the mail server</DL>
441</DD>
442</DL>
443<HR>
444
445<A NAME="replyto(java.lang.String)"><!-- --></A><H3>
446replyto</H3>
447<PRE>
448public void <B>replyto</B>(java.lang.String&nbsp;rto)</PRE>
449<DL>
450<DD>Sets the replyto address
451 This method may be
452 called multiple times.
453<P>
454<DD><DL>
455<DT><B>Parameters:</B><DD><CODE>rto</CODE> - the replyto address</DL>
456</DD>
457</DL>
458<HR>
459
460<A NAME="to(java.lang.String)"><!-- --></A><H3>
461to</H3>
462<PRE>
463public void <B>to</B>(java.lang.String&nbsp;to)
464 throws java.io.IOException</PRE>
465<DL>
466<DD>Sets the to address. Also sets the "To" header. This method may be
467 called multiple times.
468<P>
469<DD><DL>
470<DT><B>Parameters:</B><DD><CODE>to</CODE> - the to address
471<DT><B>Throws:</B>
472<DD><CODE>java.io.IOException</CODE> - if there's any problem reported by the mail server</DL>
473</DD>
474</DL>
475<HR>
476
477<A NAME="cc(java.lang.String)"><!-- --></A><H3>
478cc</H3>
479<PRE>
480public void <B>cc</B>(java.lang.String&nbsp;cc)
481 throws java.io.IOException</PRE>
482<DL>
483<DD>Sets the cc address. Also sets the "Cc" header. This method may be
484 called multiple times.
485<P>
486<DD><DL>
487<DT><B>Parameters:</B><DD><CODE>cc</CODE> - the cc address
488<DT><B>Throws:</B>
489<DD><CODE>java.io.IOException</CODE> - if there's any problem reported by the mail server</DL>
490</DD>
491</DL>
492<HR>
493
494<A NAME="bcc(java.lang.String)"><!-- --></A><H3>
495bcc</H3>
496<PRE>
497public void <B>bcc</B>(java.lang.String&nbsp;bcc)
498 throws java.io.IOException</PRE>
499<DL>
500<DD>Sets the bcc address. Does NOT set any header since it's a *blind* copy.
501 This method may be called multiple times.
502<P>
503<DD><DL>
504<DT><B>Parameters:</B><DD><CODE>bcc</CODE> - the bcc address
505<DT><B>Throws:</B>
506<DD><CODE>java.io.IOException</CODE> - if there's any problem reported by the mail server</DL>
507</DD>
508</DL>
509<HR>
510
511<A NAME="setSubject(java.lang.String)"><!-- --></A><H3>
512setSubject</H3>
513<PRE>
514public void <B>setSubject</B>(java.lang.String&nbsp;subj)</PRE>
515<DL>
516<DD>Sets the subject of the mail message. Actually sets the "Subject"
517 header.
518<P>
519<DD><DL>
520<DT><B>Parameters:</B><DD><CODE>subj</CODE> - the subject of the mail message</DL>
521</DD>
522</DL>
523<HR>
524
525<A NAME="setHeader(java.lang.String, java.lang.String)"><!-- --></A><H3>
526setHeader</H3>
527<PRE>
528public void <B>setHeader</B>(java.lang.String&nbsp;name,
529 java.lang.String&nbsp;value)</PRE>
530<DL>
531<DD>Sets the named header to the given value. RFC 822 provides the rules for
532 what text may constitute a header name and value.
533<P>
534<DD><DL>
535<DT><B>Parameters:</B><DD><CODE>name</CODE> - name of the header<DD><CODE>value</CODE> - contents of the header</DL>
536</DD>
537</DL>
538<HR>
539
540<A NAME="getPrintStream()"><!-- --></A><H3>
541getPrintStream</H3>
542<PRE>
543public java.io.PrintStream <B>getPrintStream</B>()
544 throws java.io.IOException</PRE>
545<DL>
546<DD>Returns a PrintStream that can be used to write the body of the message.
547 A stream is used since email bodies are byte-oriented. A writer can
548 be wrapped on top if necessary for internationalization.
549 This is actually done in Message.java
550<P>
551<DD><DL>
552
553<DT><B>Returns:</B><DD>a printstream containing the data and the headers of the email
554<DT><B>Throws:</B>
555<DD><CODE>java.io.IOException</CODE> - if there's any problem reported by the mail server<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/tools/ant/taskdefs/email/Message.html" title="class in org.apache.tools.ant.taskdefs.email"><CODE>Message</CODE></A></DL>
556</DD>
557</DL>
558<HR>
559
560<A NAME="sendAndClose()"><!-- --></A><H3>
561sendAndClose</H3>
562<PRE>
563public void <B>sendAndClose</B>()
564 throws java.io.IOException</PRE>
565<DL>
566<DD>Sends the message and closes the connection to the server.
567 The MailMessage object cannot be reused.
568<P>
569<DD><DL>
570
571<DT><B>Throws:</B>
572<DD><CODE>java.io.IOException</CODE> - if there's any problem reported by the mail server</DL>
573</DD>
574</DL>
575<!-- ========= END OF CLASS DATA ========= -->
576<HR>
577
578
579<!-- ======= START OF BOTTOM NAVBAR ====== -->
580<A NAME="navbar_bottom"><!-- --></A>
581<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
582<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
583<TR>
584<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
585<A NAME="navbar_bottom_firstrow"><!-- --></A>
586<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
587 <TR ALIGN="center" VALIGN="top">
588 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
589 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
590 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
591 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
592 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
593 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
594 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
595 </TR>
596</TABLE>
597</TD>
598<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
599</EM>
600</TD>
601</TR>
602
603<TR>
604<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
605&nbsp;PREV CLASS&nbsp;
606&nbsp;<A HREF="../../../../org/apache/tools/mail/SmtpResponseReader.html" title="class in org.apache.tools.mail"><B>NEXT CLASS</B></A></FONT></TD>
607<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
608 <A HREF="../../../../index.html" target="_top"><B>FRAMES</B></A> &nbsp;
609&nbsp;<A HREF="MailMessage.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
610&nbsp;<SCRIPT type="text/javascript">
611 <!--
612 if(window==top) {
613 document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
614 }
615 //-->
616</SCRIPT>
617<NOSCRIPT>
618 <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
619</NOSCRIPT>
620
621</FONT></TD>
622</TR>
623<TR>
624<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
625 SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
626<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
627DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
628</TR>
629</TABLE>
630<A NAME="skip-navbar_bottom"></A>
631<!-- ======== END OF BOTTOM NAVBAR ======= -->
632
633<HR>
634Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.
635</BODY>
636</HTML>
Note: See TracBrowser for help on using the repository browser.