Subversion Repositories javautils

Rev

Blame | Last modification | View Log | RSS feed

  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.6.0_10) on Tue Nov 17 12:13:38 PST 2009 -->
  6. <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  7. <TITLE>
  8. Transport (JavaMail API documentation)
  9. </TITLE>
  10.  
  11. <META NAME="date" CONTENT="2009-11-17">
  12.  
  13. <LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
  14.  
  15. <SCRIPT type="text/javascript">
  16. function windowTitle()
  17. {
  18.     if (location.href.indexOf('is-external=true') == -1) {
  19.         parent.document.title="Transport (JavaMail API documentation)";
  20.     }
  21. }
  22. </SCRIPT>
  23. <NOSCRIPT>
  24. </NOSCRIPT>
  25.  
  26. </HEAD>
  27.  
  28. <BODY BGCOLOR="white" onload="windowTitle();">
  29. <HR>
  30.  
  31.  
  32. <!-- ========= START OF TOP NAVBAR ======= -->
  33. <A NAME="navbar_top"><!-- --></A>
  34. <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
  35. <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
  36. <TR>
  37. <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
  38. <A NAME="navbar_top_firstrow"><!-- --></A>
  39. <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  40.   <TR ALIGN="center" VALIGN="top">
  41.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  42.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  43.   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  44.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Transport.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  45.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  46.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  47.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  48.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  49.   </TR>
  50. </TABLE>
  51. </TD>
  52. <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
  53. </EM>
  54. </TD>
  55. </TR>
  56.  
  57. <TR>
  58. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  59. &nbsp;<A HREF="../../javax/mail/StoreClosedException.html" title="class in javax.mail"><B>PREV CLASS</B></A>&nbsp;
  60. &nbsp;<A HREF="../../javax/mail/UIDFolder.html" title="interface in javax.mail"><B>NEXT CLASS</B></A></FONT></TD>
  61. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  62.   <A HREF="../../index.html?javax/mail/Transport.html" target="_top"><B>FRAMES</B></A>  &nbsp;
  63. &nbsp;<A HREF="Transport.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
  64. &nbsp;<SCRIPT type="text/javascript">
  65.   <!--
  66.   if(window==top) {
  67.     document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
  68.   }
  69.   //-->
  70. </SCRIPT>
  71. <NOSCRIPT>
  72.   <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
  73. </NOSCRIPT>
  74.  
  75.  
  76. </FONT></TD>
  77. </TR>
  78. <TR>
  79. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  80.   SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_javax.mail.Service">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
  81. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  82. DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
  83. </TR>
  84. </TABLE>
  85. <A NAME="skip-navbar_top"></A>
  86. <!-- ========= END OF TOP NAVBAR ========= -->
  87.  
  88. <HR>
  89. <!-- ======== START OF CLASS DATA ======== -->
  90. <H2>
  91. <FONT SIZE="-1">
  92. javax.mail</FONT>
  93. <BR>
  94. Class Transport</H2>
  95. <PRE>
  96. <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
  97.   <IMG SRC="../../resources/inherit.gif" ALT="extended by "><A HREF="../../javax/mail/Service.html" title="class in javax.mail">javax.mail.Service</A>
  98.       <IMG SRC="../../resources/inherit.gif" ALT="extended by "><B>javax.mail.Transport</B>
  99. </PRE>
  100. <DL>
  101. <DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../com/sun/mail/smtp/SMTPTransport.html" title="class in com.sun.mail.smtp">SMTPTransport</A></DD>
  102. </DL>
  103. <HR>
  104. <DL>
  105. <DT><PRE>public abstract class <B>Transport</B><DT>extends <A HREF="../../javax/mail/Service.html" title="class in javax.mail">Service</A></DL>
  106. </PRE>
  107.  
  108. <P>
  109. An abstract class that models a message transport.
  110.  Subclasses provide actual implementations. <p>
  111.  
  112.  Note that <code>Transport</code> extends the <code>Service</code>
  113.  class, which provides many common methods for naming transports,
  114.  connecting to transports, and listening to connection events.
  115. <P>
  116.  
  117. <P>
  118. <DL>
  119. <DT><B>See Also:</B><DD><A HREF="../../javax/mail/Service.html" title="class in javax.mail"><CODE>Service</CODE></A>,
  120. <A HREF="../../javax/mail/event/ConnectionEvent.html" title="class in javax.mail.event"><CODE>ConnectionEvent</CODE></A>,
  121. <A HREF="../../javax/mail/event/TransportEvent.html" title="class in javax.mail.event"><CODE>TransportEvent</CODE></A></DL>
  122. <HR>
  123.  
  124. <P>
  125. <!-- =========== FIELD SUMMARY =========== -->
  126.  
  127. <A NAME="field_summary"><!-- --></A>
  128. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  129. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  130. <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
  131. <B>Field Summary</B></FONT></TH>
  132. </TR>
  133. </TABLE>
  134. &nbsp;<A NAME="fields_inherited_from_class_javax.mail.Service"><!-- --></A>
  135. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  136. <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
  137. <TH ALIGN="left"><B>Fields inherited from class javax.mail.<A HREF="../../javax/mail/Service.html" title="class in javax.mail">Service</A></B></TH>
  138. </TR>
  139. <TR BGCOLOR="white" CLASS="TableRowColor">
  140. <TD><CODE><A HREF="../../javax/mail/Service.html#debug">debug</A>, <A HREF="../../javax/mail/Service.html#session">session</A>, <A HREF="../../javax/mail/Service.html#url">url</A></CODE></TD>
  141. </TR>
  142. </TABLE>
  143. &nbsp;
  144. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  145.  
  146. <A NAME="constructor_summary"><!-- --></A>
  147. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  148. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  149. <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
  150. <B>Constructor Summary</B></FONT></TH>
  151. </TR>
  152. <TR BGCOLOR="white" CLASS="TableRowColor">
  153. <TD><CODE><B><A HREF="../../javax/mail/Transport.html#Transport(javax.mail.Session, javax.mail.URLName)">Transport</A></B>(<A HREF="../../javax/mail/Session.html" title="class in javax.mail">Session</A>&nbsp;session,
  154.           <A HREF="../../javax/mail/URLName.html" title="class in javax.mail">URLName</A>&nbsp;urlname)</CODE>
  155.  
  156. <BR>
  157. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructor.</TD>
  158. </TR>
  159. </TABLE>
  160. &nbsp;
  161. <!-- ========== METHOD SUMMARY =========== -->
  162.  
  163. <A NAME="method_summary"><!-- --></A>
  164. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  165. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  166. <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
  167. <B>Method Summary</B></FONT></TH>
  168. </TR>
  169. <TR BGCOLOR="white" CLASS="TableRowColor">
  170. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  171. <CODE>&nbsp;void</CODE></FONT></TD>
  172. <TD><CODE><B><A HREF="../../javax/mail/Transport.html#addTransportListener(javax.mail.event.TransportListener)">addTransportListener</A></B>(<A HREF="../../javax/mail/event/TransportListener.html" title="interface in javax.mail.event">TransportListener</A>&nbsp;l)</CODE>
  173.  
  174. <BR>
  175. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Add a listener for Transport events.</TD>
  176. </TR>
  177. <TR BGCOLOR="white" CLASS="TableRowColor">
  178. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  179. <CODE>protected &nbsp;void</CODE></FONT></TD>
  180. <TD><CODE><B><A HREF="../../javax/mail/Transport.html#notifyTransportListeners(int, javax.mail.Address[], javax.mail.Address[], javax.mail.Address[], javax.mail.Message)">notifyTransportListeners</A></B>(int&nbsp;type,
  181.                          <A HREF="../../javax/mail/Address.html" title="class in javax.mail">Address</A>[]&nbsp;validSent,
  182.                          <A HREF="../../javax/mail/Address.html" title="class in javax.mail">Address</A>[]&nbsp;validUnsent,
  183.                          <A HREF="../../javax/mail/Address.html" title="class in javax.mail">Address</A>[]&nbsp;invalid,
  184.                          <A HREF="../../javax/mail/Message.html" title="class in javax.mail">Message</A>&nbsp;msg)</CODE>
  185.  
  186. <BR>
  187. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Notify all TransportListeners.</TD>
  188. </TR>
  189. <TR BGCOLOR="white" CLASS="TableRowColor">
  190. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  191. <CODE>&nbsp;void</CODE></FONT></TD>
  192. <TD><CODE><B><A HREF="../../javax/mail/Transport.html#removeTransportListener(javax.mail.event.TransportListener)">removeTransportListener</A></B>(<A HREF="../../javax/mail/event/TransportListener.html" title="interface in javax.mail.event">TransportListener</A>&nbsp;l)</CODE>
  193.  
  194. <BR>
  195. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Remove a listener for Transport events.</TD>
  196. </TR>
  197. <TR BGCOLOR="white" CLASS="TableRowColor">
  198. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  199. <CODE>static&nbsp;void</CODE></FONT></TD>
  200. <TD><CODE><B><A HREF="../../javax/mail/Transport.html#send(javax.mail.Message)">send</A></B>(<A HREF="../../javax/mail/Message.html" title="class in javax.mail">Message</A>&nbsp;msg)</CODE>
  201.  
  202. <BR>
  203. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Send a message.</TD>
  204. </TR>
  205. <TR BGCOLOR="white" CLASS="TableRowColor">
  206. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  207. <CODE>static&nbsp;void</CODE></FONT></TD>
  208. <TD><CODE><B><A HREF="../../javax/mail/Transport.html#send(javax.mail.Message, javax.mail.Address[])">send</A></B>(<A HREF="../../javax/mail/Message.html" title="class in javax.mail">Message</A>&nbsp;msg,
  209.      <A HREF="../../javax/mail/Address.html" title="class in javax.mail">Address</A>[]&nbsp;addresses)</CODE>
  210.  
  211. <BR>
  212. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Send the message to the specified addresses, ignoring any
  213.  recipients specified in the message itself.</TD>
  214. </TR>
  215. <TR BGCOLOR="white" CLASS="TableRowColor">
  216. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  217. <CODE>abstract &nbsp;void</CODE></FONT></TD>
  218. <TD><CODE><B><A HREF="../../javax/mail/Transport.html#sendMessage(javax.mail.Message, javax.mail.Address[])">sendMessage</A></B>(<A HREF="../../javax/mail/Message.html" title="class in javax.mail">Message</A>&nbsp;msg,
  219.             <A HREF="../../javax/mail/Address.html" title="class in javax.mail">Address</A>[]&nbsp;addresses)</CODE>
  220.  
  221. <BR>
  222. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Send the Message to the specified list of addresses.</TD>
  223. </TR>
  224. </TABLE>
  225. &nbsp;<A NAME="methods_inherited_from_class_javax.mail.Service"><!-- --></A>
  226. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  227. <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
  228. <TH ALIGN="left"><B>Methods inherited from class javax.mail.<A HREF="../../javax/mail/Service.html" title="class in javax.mail">Service</A></B></TH>
  229. </TR>
  230. <TR BGCOLOR="white" CLASS="TableRowColor">
  231. <TD><CODE><A HREF="../../javax/mail/Service.html#addConnectionListener(javax.mail.event.ConnectionListener)">addConnectionListener</A>, <A HREF="../../javax/mail/Service.html#close()">close</A>, <A HREF="../../javax/mail/Service.html#connect()">connect</A>, <A HREF="../../javax/mail/Service.html#connect(java.lang.String, int, java.lang.String, java.lang.String)">connect</A>, <A HREF="../../javax/mail/Service.html#connect(java.lang.String, java.lang.String)">connect</A>, <A HREF="../../javax/mail/Service.html#connect(java.lang.String, java.lang.String, java.lang.String)">connect</A>, <A HREF="../../javax/mail/Service.html#finalize()">finalize</A>, <A HREF="../../javax/mail/Service.html#getURLName()">getURLName</A>, <A HREF="../../javax/mail/Service.html#isConnected()">isConnected</A>, <A HREF="../../javax/mail/Service.html#notifyConnectionListeners(int)">notifyConnectionListeners</A>, <A HREF="../../javax/mail/Service.html#protocolConnect(java.lang.String, int, java.lang.String, java.lang.String)">protocolConnect</A>, <A HREF="../../javax/mail/Service.html#queueEvent(javax.mail.event.MailEvent, java.util.Vector)">queueEvent</A>, <A HREF="../../javax/mail/Service.html#removeConnectionListener(javax.mail.event.ConnectionListener)">removeConnectionListener</A>, <A HREF="../../javax/mail/Service.html#setConnected(boolean)">setConnected</A>, <A HREF="../../javax/mail/Service.html#setURLName(javax.mail.URLName)">setURLName</A>, <A HREF="../../javax/mail/Service.html#toString()">toString</A></CODE></TD>
  232. </TR>
  233. </TABLE>
  234. &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
  235. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  236. <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
  237. <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
  238. </TR>
  239. <TR BGCOLOR="white" CLASS="TableRowColor">
  240. <TD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
  241. </TR>
  242. </TABLE>
  243. &nbsp;
  244. <P>
  245.  
  246. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  247.  
  248. <A NAME="constructor_detail"><!-- --></A>
  249. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  250. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  251. <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
  252. <B>Constructor Detail</B></FONT></TH>
  253. </TR>
  254. </TABLE>
  255.  
  256. <A NAME="Transport(javax.mail.Session, javax.mail.URLName)"><!-- --></A><H3>
  257. Transport</H3>
  258. <PRE>
  259. public <B>Transport</B>(<A HREF="../../javax/mail/Session.html" title="class in javax.mail">Session</A>&nbsp;session,
  260.                  <A HREF="../../javax/mail/URLName.html" title="class in javax.mail">URLName</A>&nbsp;urlname)</PRE>
  261. <DL>
  262. <DD>Constructor.
  263. <P>
  264. <DL>
  265. <DT><B>Parameters:</B><DD><CODE>session</CODE> - Session object for this Transport.<DD><CODE>urlname</CODE> - URLName object to be used for this Transport</DL>
  266. </DL>
  267.  
  268. <!-- ============ METHOD DETAIL ========== -->
  269.  
  270. <A NAME="method_detail"><!-- --></A>
  271. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  272. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  273. <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
  274. <B>Method Detail</B></FONT></TH>
  275. </TR>
  276. </TABLE>
  277.  
  278. <A NAME="send(javax.mail.Message)"><!-- --></A><H3>
  279. send</H3>
  280. <PRE>
  281. public static void <B>send</B>(<A HREF="../../javax/mail/Message.html" title="class in javax.mail">Message</A>&nbsp;msg)
  282.                  throws <A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
  283. <DL>
  284. <DD>Send a message.  The message will be sent to all recipient
  285.  addresses specified in the message (as returned from the
  286.  <code>Message</code> method <code>getAllRecipients</code>),
  287.  using message transports appropriate to each address.  The
  288.  <code>send</code> method calls the <code>saveChanges</code>
  289.  method on the message before sending it. <p>
  290.  
  291.  If any of the recipient addresses is detected to be invalid by
  292.  the Transport during message submission, a SendFailedException
  293.  is thrown.  Clients can get more detail about the failure by examining
  294.  the exception.  Whether or not the message is still sent successfully
  295.  to any valid addresses depends on the Transport implementation.  See
  296.  SendFailedException for more details.  Note also that success does
  297.  not imply that the message was delivered to the ultimate recipient,
  298.  as failures may occur in later stages of delivery.  Once a Transport
  299.  accepts a message for delivery to a recipient, failures that occur later
  300.  should be reported to the user via another mechanism, such as
  301.  returning the undeliverable message. <p>
  302.  
  303.  In typical usage, a SendFailedException reflects an error detected
  304.  by the server.  The details of the SendFailedException will usually
  305.  contain the error message from the server (such as an SMTP error
  306.  message).  An address may be detected as invalid for a variety of
  307.  reasons - the address may not exist, the address may have invalid
  308.  syntax, the address may have exceeded its quota, etc. <p>
  309.  
  310.  Note that <code>send</code> is a static method that creates and
  311.  manages its own connection.  Any connection associated with any
  312.  Transport instance used to invoke this method is ignored and not
  313.  used.  This method should only be invoked using the form
  314.  <code>Transport.send(msg);</code>, and should never be invoked
  315.  using an instance variable.
  316. <P>
  317. <DD><DL>
  318. <DT><B>Parameters:</B><DD><CODE>msg</CODE> - the message to send
  319. <DT><B>Throws:</B>
  320. <DD><CODE><A HREF="../../javax/mail/SendFailedException.html" title="class in javax.mail">SendFailedException</A></CODE> - if the message could not
  321.                         be sent to some or any of the recipients.
  322. <DD><CODE><A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE><DT><B>See Also:</B><DD><A HREF="../../javax/mail/Message.html#saveChanges()"><CODE>Message.saveChanges()</CODE></A>,
  323. <A HREF="../../javax/mail/Message.html#getAllRecipients()"><CODE>Message.getAllRecipients()</CODE></A>,
  324. <A HREF="../../javax/mail/Transport.html#send(javax.mail.Message, javax.mail.Address[])"><CODE>send(Message, Address[])</CODE></A>,
  325. <A HREF="../../javax/mail/SendFailedException.html" title="class in javax.mail"><CODE>SendFailedException</CODE></A></DL>
  326. </DD>
  327. </DL>
  328. <HR>
  329.  
  330. <A NAME="send(javax.mail.Message, javax.mail.Address[])"><!-- --></A><H3>
  331. send</H3>
  332. <PRE>
  333. public static void <B>send</B>(<A HREF="../../javax/mail/Message.html" title="class in javax.mail">Message</A>&nbsp;msg,
  334.                         <A HREF="../../javax/mail/Address.html" title="class in javax.mail">Address</A>[]&nbsp;addresses)
  335.                  throws <A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
  336. <DL>
  337. <DD>Send the message to the specified addresses, ignoring any
  338.  recipients specified in the message itself. The
  339.  <code>send</code> method calls the <code>saveChanges</code>
  340.  method on the message before sending it. <p>
  341. <P>
  342. <DD><DL>
  343. <DT><B>Parameters:</B><DD><CODE>msg</CODE> - the message to send<DD><CODE>addresses</CODE> - the addresses to which to send the message
  344. <DT><B>Throws:</B>
  345. <DD><CODE><A HREF="../../javax/mail/SendFailedException.html" title="class in javax.mail">SendFailedException</A></CODE> - if the message could not
  346.                         be sent to some or any of the recipients.
  347. <DD><CODE><A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE><DT><B>See Also:</B><DD><A HREF="../../javax/mail/Message.html#saveChanges()"><CODE>Message.saveChanges()</CODE></A>,
  348. <A HREF="../../javax/mail/Transport.html#send(javax.mail.Message)"><CODE>send(Message)</CODE></A>,
  349. <A HREF="../../javax/mail/SendFailedException.html" title="class in javax.mail"><CODE>SendFailedException</CODE></A></DL>
  350. </DD>
  351. </DL>
  352. <HR>
  353.  
  354. <A NAME="sendMessage(javax.mail.Message, javax.mail.Address[])"><!-- --></A><H3>
  355. sendMessage</H3>
  356. <PRE>
  357. public abstract void <B>sendMessage</B>(<A HREF="../../javax/mail/Message.html" title="class in javax.mail">Message</A>&nbsp;msg,
  358.                                  <A HREF="../../javax/mail/Address.html" title="class in javax.mail">Address</A>[]&nbsp;addresses)
  359.                           throws <A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
  360. <DL>
  361. <DD>Send the Message to the specified list of addresses. An appropriate
  362.  TransportEvent indicating the delivery status is delivered to any
  363.  TransportListener registered on this Transport. Also, if any of
  364.  the addresses is invalid, a SendFailedException is thrown.
  365.  Whether or not the message is still sent succesfully to
  366.  any valid addresses depends on the Transport implementation. <p>
  367.  
  368.  Unlike the static <code>send</code> method, the <code>sendMessage</code>
  369.  method does <em>not</em> call the <code>saveChanges</code> method on
  370.  the message; the caller should do so.
  371. <P>
  372. <DD><DL>
  373. <DT><B>Parameters:</B><DD><CODE>msg</CODE> - The Message to be sent<DD><CODE>addresses</CODE> - array of addresses to send this message to
  374. <DT><B>Throws:</B>
  375. <DD><CODE><A HREF="../../javax/mail/SendFailedException.html" title="class in javax.mail">SendFailedException</A></CODE> - if the send failed because of
  376.                         invalid addresses.
  377. <DD><CODE><A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE> - if the connection is dead or not in the
  378.                                 connected state<DT><B>See Also:</B><DD><A HREF="../../javax/mail/event/TransportEvent.html" title="class in javax.mail.event"><CODE>TransportEvent</CODE></A></DL>
  379. </DD>
  380. </DL>
  381. <HR>
  382.  
  383. <A NAME="addTransportListener(javax.mail.event.TransportListener)"><!-- --></A><H3>
  384. addTransportListener</H3>
  385. <PRE>
  386. public void <B>addTransportListener</B>(<A HREF="../../javax/mail/event/TransportListener.html" title="interface in javax.mail.event">TransportListener</A>&nbsp;l)</PRE>
  387. <DL>
  388. <DD>Add a listener for Transport events. <p>
  389.  
  390.  The default implementation provided here adds this listener
  391.  to an internal list of TransportListeners.
  392. <P>
  393. <DD><DL>
  394. <DT><B>Parameters:</B><DD><CODE>l</CODE> - the Listener for Transport events<DT><B>See Also:</B><DD><A HREF="../../javax/mail/event/TransportEvent.html" title="class in javax.mail.event"><CODE>TransportEvent</CODE></A></DL>
  395. </DD>
  396. </DL>
  397. <HR>
  398.  
  399. <A NAME="removeTransportListener(javax.mail.event.TransportListener)"><!-- --></A><H3>
  400. removeTransportListener</H3>
  401. <PRE>
  402. public void <B>removeTransportListener</B>(<A HREF="../../javax/mail/event/TransportListener.html" title="interface in javax.mail.event">TransportListener</A>&nbsp;l)</PRE>
  403. <DL>
  404. <DD>Remove a listener for Transport events. <p>
  405.  
  406.  The default implementation provided here removes this listener
  407.  from the internal list of TransportListeners.
  408. <P>
  409. <DD><DL>
  410. <DT><B>Parameters:</B><DD><CODE>l</CODE> - the listener<DT><B>See Also:</B><DD><A HREF="../../javax/mail/Transport.html#addTransportListener(javax.mail.event.TransportListener)"><CODE>addTransportListener(javax.mail.event.TransportListener)</CODE></A></DL>
  411. </DD>
  412. </DL>
  413. <HR>
  414.  
  415. <A NAME="notifyTransportListeners(int, javax.mail.Address[], javax.mail.Address[], javax.mail.Address[], javax.mail.Message)"><!-- --></A><H3>
  416. notifyTransportListeners</H3>
  417. <PRE>
  418. protected void <B>notifyTransportListeners</B>(int&nbsp;type,
  419.                                         <A HREF="../../javax/mail/Address.html" title="class in javax.mail">Address</A>[]&nbsp;validSent,
  420.                                         <A HREF="../../javax/mail/Address.html" title="class in javax.mail">Address</A>[]&nbsp;validUnsent,
  421.                                         <A HREF="../../javax/mail/Address.html" title="class in javax.mail">Address</A>[]&nbsp;invalid,
  422.                                         <A HREF="../../javax/mail/Message.html" title="class in javax.mail">Message</A>&nbsp;msg)</PRE>
  423. <DL>
  424. <DD>Notify all TransportListeners. Transport implementations are
  425.  expected to use this method to broadcast TransportEvents.<p>
  426.  
  427.  The provided default implementation queues the event into
  428.  an internal event queue. An event dispatcher thread dequeues
  429.  events from the queue and dispatches them to the registered
  430.  TransportListeners. Note that the event dispatching occurs
  431.  in a separate thread, thus avoiding potential deadlock problems.
  432. <P>
  433. <DD><DL>
  434. </DL>
  435. </DD>
  436. </DL>
  437. <!-- ========= END OF CLASS DATA ========= -->
  438. <HR>
  439.  
  440.  
  441. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  442. <A NAME="navbar_bottom"><!-- --></A>
  443. <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
  444. <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
  445. <TR>
  446. <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
  447. <A NAME="navbar_bottom_firstrow"><!-- --></A>
  448. <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  449.   <TR ALIGN="center" VALIGN="top">
  450.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  451.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  452.   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  453.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Transport.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  454.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  455.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  456.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  457.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  458.   </TR>
  459. </TABLE>
  460. </TD>
  461. <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
  462. </EM>
  463. </TD>
  464. </TR>
  465.  
  466. <TR>
  467. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  468. &nbsp;<A HREF="../../javax/mail/StoreClosedException.html" title="class in javax.mail"><B>PREV CLASS</B></A>&nbsp;
  469. &nbsp;<A HREF="../../javax/mail/UIDFolder.html" title="interface in javax.mail"><B>NEXT CLASS</B></A></FONT></TD>
  470. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  471.   <A HREF="../../index.html?javax/mail/Transport.html" target="_top"><B>FRAMES</B></A>  &nbsp;
  472. &nbsp;<A HREF="Transport.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
  473. &nbsp;<SCRIPT type="text/javascript">
  474.   <!--
  475.   if(window==top) {
  476.     document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
  477.   }
  478.   //-->
  479. </SCRIPT>
  480. <NOSCRIPT>
  481.   <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
  482. </NOSCRIPT>
  483.  
  484.  
  485. </FONT></TD>
  486. </TR>
  487. <TR>
  488. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  489.   SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_javax.mail.Service">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
  490. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  491. DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
  492. </TR>
  493. </TABLE>
  494. <A NAME="skip-navbar_bottom"></A>
  495. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  496.  
  497. <HR>
  498. Copyright &#169; 2009 <a href="http://www.sun.com">Sun Microsystems, Inc.</a>. All Rights Reserved.
  499. </BODY>
  500. </HTML>
  501.