transport.html
来自「j2ee帮助文档软件设计/软件工程 文件格式」· HTML 代码 · 共 489 行 · 第 1/2 页
HTML
489 行
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TH></TR></TABLE><A NAME="Transport(javax.mail.Session, javax.mail.URLName)"><!-- --></A><H3>Transport</H3><PRE>public <B>Transport</B>(<A HREF="../../javax/mail/Session.html" title="class in javax.mail">Session</A> session, <A HREF="../../javax/mail/URLName.html" title="class in javax.mail">URLName</A> urlname)</PRE><DL><DD>Constructor.<P><DL><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></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="send(javax.mail.Message)"><!-- --></A><H3>send</H3><PRE>public static void <B>send</B>(<A HREF="../../javax/mail/Message.html" title="class in javax.mail">Message</A> msg) throws <A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE><DL><DD>Send a message. The message will be sent to all recipient addresses specified in the message (as returned from the <code>Message</code> method <code>getAllRecipients</code>), using message transports appropriate to each address. The <code>send</code> method calls the <code>saveChanges</code> method on the message before sending it. <p> If any of the recipient addresses is detected to be invalid by the Transport during message submission, a SendFailedException is thrown. Clients can get more detail about the failure by examining the exception. Whether or not the message is still sent succesfully to any valid addresses depends on the Transport implementation. See SendFailedException for more details. Note also that success does not imply that the message was delivered to the ultimate recipient, as failures may occur in later stages of delivery. Once a Transport accepts a message for delivery to a recipient, failures that occur later should be reported to the user via another mechanism, such as returning the undeliverable message. <p> Note that <code>send</code> is a static method that creates and manages its own connection. Any connection associated with any Transport instance used to invoke this method is ignored and not used. This method should only be invoked using the form <code>Transport.send(msg);</code>, and should never be invoked using an instance variable.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>msg</CODE> - the message to send<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/mail/SendFailedException.html" title="class in javax.mail">SendFailedException</A></CODE> - if the message could not be sent to some or any of the recipients.<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>, <A HREF="../../javax/mail/Message.html#getAllRecipients()"><CODE>Message.getAllRecipients()</CODE></A>, <A HREF="../../javax/mail/Transport.html#send(javax.mail.Message, javax.mail.Address[])"><CODE>send(Message, Address[])</CODE></A>, <A HREF="../../javax/mail/SendFailedException.html" title="class in javax.mail"><CODE>SendFailedException</CODE></A></DL></DD></DL><HR><A NAME="send(javax.mail.Message, javax.mail.Address[])"><!-- --></A><H3>send</H3><PRE>public static void <B>send</B>(<A HREF="../../javax/mail/Message.html" title="class in javax.mail">Message</A> msg, <A HREF="../../javax/mail/Address.html" title="class in javax.mail">Address</A>[] addresses) throws <A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE><DL><DD>Send the message to the specified addresses, ignoring any recipients specified in the message itself. The <code>send</code> method calls the <code>saveChanges</code> method on the message before sending it. <p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>msg</CODE> - the message to send<DD><CODE>addresses</CODE> - the addresses to which to send the message<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/mail/SendFailedException.html" title="class in javax.mail">SendFailedException</A></CODE> - if the message could not be sent to some or any of the recipients.<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>, <A HREF="../../javax/mail/Transport.html#send(javax.mail.Message)"><CODE>send(Message)</CODE></A>, <A HREF="../../javax/mail/SendFailedException.html" title="class in javax.mail"><CODE>SendFailedException</CODE></A></DL></DD></DL><HR><A NAME="sendMessage(javax.mail.Message, javax.mail.Address[])"><!-- --></A><H3>sendMessage</H3><PRE>public abstract void <B>sendMessage</B>(<A HREF="../../javax/mail/Message.html" title="class in javax.mail">Message</A> msg, <A HREF="../../javax/mail/Address.html" title="class in javax.mail">Address</A>[] addresses) throws <A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE><DL><DD>Send the Message to the specified list of addresses. An appropriate TransportEvent indicating the delivery status is delivered to any TransportListener registered on this Transport. Also, if any of the addresses is invalid, a SendFailedException is thrown. Whether or not the message is still sent succesfully to any valid addresses depends on the Transport implementation. <p> Unlike the static <code>send</code> method, the <code>sendMessage</code> method does <em>not</em> call the <code>saveChanges</code> method on the message; the caller should do so.<P><DD><DL><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<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/mail/SendFailedException.html" title="class in javax.mail">SendFailedException</A></CODE> - if the send failed because of invalid addresses.<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 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></DD></DL><HR><A NAME="addTransportListener(javax.mail.event.TransportListener)"><!-- --></A><H3>addTransportListener</H3><PRE>public void <B>addTransportListener</B>(<A HREF="../../javax/mail/event/TransportListener.html" title="interface in javax.mail.event">TransportListener</A> l)</PRE><DL><DD>Add a listener for Transport events. <p> The default implementation provided here adds this listener to an internal list of TransportListeners.<P><DD><DL><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></DD></DL><HR><A NAME="removeTransportListener(javax.mail.event.TransportListener)"><!-- --></A><H3>removeTransportListener</H3><PRE>public void <B>removeTransportListener</B>(<A HREF="../../javax/mail/event/TransportListener.html" title="interface in javax.mail.event">TransportListener</A> l)</PRE><DL><DD>Remove a listener for Transport events. <p> The default implementation provided here removes this listener from the internal list of TransportListeners.<P><DD><DL><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></DD></DL><HR><A NAME="notifyTransportListeners(int, javax.mail.Address[], javax.mail.Address[], javax.mail.Address[], javax.mail.Message)"><!-- --></A><H3>notifyTransportListeners</H3><PRE>protected void <B>notifyTransportListeners</B>(int type, <A HREF="../../javax/mail/Address.html" title="class in javax.mail">Address</A>[] validSent, <A HREF="../../javax/mail/Address.html" title="class in javax.mail">Address</A>[] validUnsent, <A HREF="../../javax/mail/Address.html" title="class in javax.mail">Address</A>[] invalid, <A HREF="../../javax/mail/Message.html" title="class in javax.mail">Message</A> msg)</PRE><DL><DD>Notify all TransportListeners. Transport implementations are expected to use this method to broadcast TransportEvents.<p> The provided default implementation queues the event into an internal event queue. An event dispatcher thread dequeues events from the queue and dispatches them to the registered TransportListeners. Note that the event dispatching occurs in a separate thread, thus avoiding potential deadlock problems.<P><DD><DL></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <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="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="../../javax/mail/StoreClosedException.html" title="class in javax.mail"><B>PREV CLASS</B></A> <A HREF="../../javax/mail/UIDFolder.html" title="interface in javax.mail"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html?javax/mail/Transport.html" target="_top"><B>FRAMES</B></A> <A HREF="Transport.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#fields_inherited_from_class_javax.mail.Service">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><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><font size="-1"><a href="http://java.sun.com/webapps/bugreport">Submit a bug or feature</a> <p>Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to <a href="../legal/license.html" target="_top">license terms.</a></font></BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?