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:43 PST 2009 -->
  6. <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  7. <TITLE>
  8. com.sun.mail.smtp (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="com.sun.mail.smtp (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="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT>&nbsp;</TD>
  43.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
  44.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-use.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="../../../../com/sun/mail/pop3/package-summary.html"><B>PREV PACKAGE</B></A>&nbsp;
  60. &nbsp;<A HREF="../../../../com/sun/mail/util/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD>
  61. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  62.   <A HREF="../../../../index.html?com/sun/mail/smtp/package-summary.html" target="_top"><B>FRAMES</B></A>  &nbsp;
  63. &nbsp;<A HREF="package-summary.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. </TABLE>
  79. <A NAME="skip-navbar_top"></A>
  80. <!-- ========= END OF TOP NAVBAR ========= -->
  81.  
  82. <HR>
  83. <H2>
  84. Package com.sun.mail.smtp
  85. </H2>
  86. An SMTP protocol provider for the JavaMail API
  87. that provides access to an SMTP server.
  88. <P>
  89. <B>See:</B>
  90. <BR>
  91. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="#package_description"><B>Description</B></A>
  92. <P>
  93.  
  94. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  95. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  96. <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
  97. <B>Class Summary</B></FONT></TH>
  98. </TR>
  99. <TR BGCOLOR="white" CLASS="TableRowColor">
  100. <TD WIDTH="15%"><B><A HREF="../../../../com/sun/mail/smtp/SMTPMessage.html" title="class in com.sun.mail.smtp">SMTPMessage</A></B></TD>
  101. <TD>This class is a specialization of the MimeMessage class that allows
  102.  you to specify various SMTP options and parameters that will be
  103.  used when this message is sent over SMTP.</TD>
  104. </TR>
  105. <TR BGCOLOR="white" CLASS="TableRowColor">
  106. <TD WIDTH="15%"><B><A HREF="../../../../com/sun/mail/smtp/SMTPSSLTransport.html" title="class in com.sun.mail.smtp">SMTPSSLTransport</A></B></TD>
  107. <TD>This class implements the Transport abstract class using SMTP
  108.  over SSL for message submission and transport.</TD>
  109. </TR>
  110. <TR BGCOLOR="white" CLASS="TableRowColor">
  111. <TD WIDTH="15%"><B><A HREF="../../../../com/sun/mail/smtp/SMTPTransport.html" title="class in com.sun.mail.smtp">SMTPTransport</A></B></TD>
  112. <TD>This class implements the Transport abstract class using SMTP for
  113.  message submission and transport.</TD>
  114. </TR>
  115. </TABLE>
  116. &nbsp;
  117.  
  118. <P>
  119.  
  120. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  121. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  122. <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
  123. <B>Exception Summary</B></FONT></TH>
  124. </TR>
  125. <TR BGCOLOR="white" CLASS="TableRowColor">
  126. <TD WIDTH="15%"><B><A HREF="../../../../com/sun/mail/smtp/SMTPAddressFailedException.html" title="class in com.sun.mail.smtp">SMTPAddressFailedException</A></B></TD>
  127. <TD>This exception is thrown when the message cannot be sent.</TD>
  128. </TR>
  129. <TR BGCOLOR="white" CLASS="TableRowColor">
  130. <TD WIDTH="15%"><B><A HREF="../../../../com/sun/mail/smtp/SMTPAddressSucceededException.html" title="class in com.sun.mail.smtp">SMTPAddressSucceededException</A></B></TD>
  131. <TD>This exception is chained off a SendFailedException when the
  132.  <code>mail.smtp.reportsuccess</code> property is true.</TD>
  133. </TR>
  134. <TR BGCOLOR="white" CLASS="TableRowColor">
  135. <TD WIDTH="15%"><B><A HREF="../../../../com/sun/mail/smtp/SMTPSendFailedException.html" title="class in com.sun.mail.smtp">SMTPSendFailedException</A></B></TD>
  136. <TD>This exception is thrown when the message cannot be sent.</TD>
  137. </TR>
  138. </TABLE>
  139. &nbsp;
  140.  
  141. <P>
  142. <A NAME="package_description"><!-- --></A><H2>
  143. Package com.sun.mail.smtp Description
  144. </H2>
  145.  
  146. <P>
  147. An SMTP protocol provider for the JavaMail API
  148. that provides access to an SMTP server.
  149. Refer to <A HREF="http://www.ietf.org/rfc/rfc821.txt" TARGET="_top">RFC 821</A>
  150. for more information.
  151. <P>
  152. When sending a message, detailed information on each address that
  153. fails is available in an
  154. <A HREF="../../../../com/sun/mail/smtp/SMTPAddressFailedException.html" title="class in com.sun.mail.smtp"><CODE>SMTPAddressFailedException</CODE></A>
  155. chained off the top level
  156. <A HREF="../../../../javax/mail/SendFailedException.html" title="class in javax.mail"><CODE>SendFailedException</CODE></A>
  157. that is thrown.
  158. In addition, if the <code>mail.smtp.reportsuccess</code> property
  159. is set, an
  160. <A HREF="../../../../com/sun/mail/smtp/SMTPAddressSucceededException.html" title="class in com.sun.mail.smtp"><CODE>SMTPAddressSucceededException</CODE></A>
  161. will be included in the list for each address that is successful.
  162. Note that this will cause a top level
  163. <A HREF="../../../../javax/mail/SendFailedException.html" title="class in javax.mail"><CODE>SendFailedException</CODE></A>
  164. to be thrown even though the send was successful.
  165. <P>
  166. The SMTP provider also supports ESMTP
  167. (<A HREF="http://www.ietf.org/rfc/rfc1651.txt" TARGET="_top">RFC 1651</A>).
  168. It can optionally use SMTP Authentication
  169. (<A HREF="http://www.ietf.org/rfc/rfc2554.txt" TARGET="_top">RFC 2554</A>)
  170. using the LOGIN, PLAIN, DIGEST-MD5, and NTLM mechanisms
  171. (<A HREF="http://www.ietf.org/rfc/rfc2592.txt" TARGET="_top">RFC 2592</A>
  172. and <A HREF="http://www.ietf.org/rfc/rfc2831.txt" TARGET="_top">RFC 2831</A>).
  173. <P>
  174. To use SMTP authentication you'll need to set the <code>mail.smtp.auth</code>
  175. property (see below) or provide the SMTP Transport
  176. with a username and password when connecting to the SMTP server.  You
  177. can do this using one of the following approaches:
  178. <P>
  179. <UL>
  180. <LI>
  181. Provide an Authenticator object when creating your mail Session
  182. and provide the username and password information during the
  183. Authenticator callback.
  184. <P>
  185. Note that the <code>mail.smtp.user</code> property can be set to provide a
  186. default username for the callback, but the password will still need to be
  187. supplied explicitly.
  188. <P>
  189. This approach allows you to use the static Transport <code>send</code> method
  190. to send messages.
  191. </LI>
  192. <P>
  193. <LI>
  194. Call the Transport <code>connect</code> method explicitly with username and
  195. password arguments.
  196. <P>
  197. This approach requires you to explicitly manage a Transport object
  198. and use the Transport <code>sendMessage</code> method to send the message.
  199. The transport.java demo program demonstrates how to manage a Transport
  200. object.  The following is roughly equivalent to the static
  201. Transport <code>send</code> method, but supplies the needed username and
  202. password:
  203. <P>
  204. <BLOCKQUOTE><PRE>
  205. Transport tr = session.getTransport("smtp");
  206. tr.connect(smtphost, username, password);
  207. msg.saveChanges();      // don't forget this
  208. tr.sendMessage(msg, msg.getAllRecipients());
  209. tr.close();
  210. </PRE></BLOCKQUOTE>
  211. </LI>
  212. </UL>
  213. <P>
  214. When using DIGEST-MD5 authentication,
  215. you'll also need to supply an appropriate realm;
  216. your mail server administrator can supply this information.
  217. You can set this using the <code>mail.smtp.sasl.realm</code> property,
  218. or the <code>setSASLRealm</code> method on <code>SMTPTransport</code>.
  219. <P>
  220. SMTP can also optionally request Delivery Status Notifications
  221. (<A HREF="http://www.ietf.org/rfc/rfc1891.txt" TARGET="_top">RFC 1891</A>).
  222. The delivery status will typically be reported using
  223. a "multipart/report"
  224. (<A HREF="http://www.ietf.org/rfc/rfc1892.txt" TARGET="_top">RFC 1892</A>)
  225. message type with a "message/delivery-status"
  226. (<A HREF="http://www.ietf.org/rfc/rfc1894.txt" TARGET="_top">RFC 1894</A>)
  227. part.
  228. You can use the classes in the <A HREF="../../../../com/sun/mail/dsn/package-summary.html"><CODE>com.sun.mail.dsn</CODE></A> package to
  229. handle these MIME types.
  230. Note that you'll need to include <code>dsn.jar</code> in your CLASSPATH
  231. as this support is not included in <code>mail.jar</code>.
  232. <P>
  233. See below for the properties to enable these features.
  234. <P>
  235. Note also that <strong>THERE IS NOT SUFFICIENT DOCUMENTATION HERE TO USE THESE
  236. FEATURES!!!</strong>  You will need to read the appropriate RFCs mentioned above
  237. to understand what these features do and how to use them.  Don't just
  238. start setting properties and then complain to us when it doesn't work
  239. like you expect it to work.  <strong>READ THE RFCs FIRST!!!</strong>
  240. <P>
  241. The SMTP protocol provider supports the following properties,
  242. which may be set in the JavaMail <code>Session</code> object.
  243. The properties are always set as strings; the Type column describes
  244. how the string is interpreted.  For example, use
  245. <PRE>
  246.         props.put("mail.smtp.port", "888");
  247. </PRE>
  248. to set the <CODE>mail.smtp.port</CODE> property, which is of type int.
  249. <P>
  250. Note that if you're using the "smtps" protocol to access SMTP over SSL,
  251. all the properties would be named "mail.smtps.*".
  252. <P>
  253. <TABLE BORDER>
  254. <TR>
  255. <TH>Name</TH>
  256. <TH>Type</TH>
  257. <TH>Description</TH>
  258. </TR>
  259.  
  260. <TR>
  261. <TD>mail.smtp.user</TD>
  262. <TD>String</TD>
  263. <TD>Default user name for SMTP.</TD>
  264. </TR>
  265.  
  266. <TR>
  267. <TD>mail.smtp.host</TD>
  268. <TD>String</TD>
  269. <TD>The SMTP server to connect to.</TD>
  270. </TR>
  271.  
  272. <TR>
  273. <TD>mail.smtp.port</TD>
  274. <TD>int</TD>
  275. <TD>The SMTP server port to connect to, if the connect() method doesn't
  276. explicitly specify one. Defaults to 25.</TD>
  277. </TR>
  278.  
  279. <TR>
  280. <TD>mail.smtp.connectiontimeout</TD>
  281. <TD>int</TD>
  282. <TD>Socket connection timeout value in milliseconds.
  283. Default is infinite timeout.</TD>
  284. </TR>
  285.  
  286. <TR>
  287. <TD>mail.smtp.timeout</TD>
  288. <TD>int</TD>
  289. <TD>Socket I/O timeout value in milliseconds.  Default is infinite timeout.</TD>
  290. </TR>
  291.  
  292. <TR>
  293. <TD>mail.smtp.from</TD>
  294. <TD>String</TD>
  295. <TD>
  296. Email address to use for SMTP MAIL command.  This sets the envelope
  297. return address.  Defaults to msg.getFrom() or
  298. InternetAddress.getLocalAddress().  NOTE: mail.smtp.user was previously
  299. used for this.
  300. </TD>
  301. </TR>
  302.  
  303. <TR>
  304. <TD>mail.smtp.localhost</TD>
  305. <TD>String</TD>
  306. <TD>
  307. Local host name used in the SMTP HELO or EHLO command.
  308. Defaults to <code>InetAddress.getLocalHost().getHostName()</code>.
  309. Should not normally need to
  310. be set if your JDK and your name service are configured properly.
  311. </TD>
  312. </TR>
  313.  
  314. <TR>
  315. <TD>mail.smtp.localaddress</TD>
  316. <TD>String</TD>
  317. <TD>
  318. Local address (host name) to bind to when creating the SMTP socket.
  319. Defaults to the address picked by the Socket class.
  320. Should not normally need to be set, but useful with multi-homed hosts
  321. where it's important to pick a particular local address to bind to.
  322. </TD>
  323. </TR>
  324.  
  325. <TR>
  326. <TD>mail.smtp.localport</TD>
  327. <TD>int</TD>
  328. <TD>
  329. Local port number to bind to when creating the SMTP socket.
  330. Defaults to the port number picked by the Socket class.
  331. </TD>
  332. </TR>
  333.  
  334. <TR>
  335. <TD>mail.smtp.ehlo</TD>
  336. <TD>boolean</TD>
  337. <TD>
  338. If false, do not attempt to sign on with the EHLO command.  Defaults to
  339. true.  Normally failure of the EHLO command will fallback to the HELO
  340. command; this property exists only for servers that don't fail EHLO
  341. properly or don't implement EHLO properly.
  342. </TD>
  343. </TR>
  344.  
  345. <TR>
  346. <TD>mail.smtp.auth</TD>
  347. <TD>boolean</TD>
  348. <TD>If true, attempt to authenticate the user using the AUTH command.
  349. Defaults to false.</TD>
  350. </TR>
  351.  
  352. <TR>
  353. <TD>mail.smtp.auth.mechanisms</TD>
  354. <TD>String</TD>
  355. <TD>
  356. If set, lists the authentication mechanisms to consider, and the order
  357. in which to consider them.  Only mechanisms supported by the server and
  358. supported by the current implementation will be used.
  359. The default is <code>"LOGIN PLAIN DIGEST-MD5 NTLM"</code>, which includes all
  360. the authentication mechanisms supported by the current implementation.
  361. </TD>
  362. </TR>
  363.  
  364. <TR>
  365. <TD>mail.smtp.auth.ntlm.domain</TD>
  366. <TD>String</TD>
  367. <TD>
  368. The NTLM authentication domain.
  369. </TD>
  370. </TR>
  371.  
  372. <TR>
  373. <TD>mail.smtp.auth.ntlm.flags</TD>
  374. <TD>int</TD>
  375. <TD>
  376. NTLM protocol-specific flags.
  377. See <A HREF="http://curl.haxx.se/rfc/ntlm.html#theNtlmFlags" TARGET="_top">
  378. http://curl.haxx.se/rfc/ntlm.html#theNtlmFlags</A> for details.
  379. </TD>
  380. </TR>
  381.  
  382. <!--
  383. <TR>
  384. <TD>mail.smtp.auth.ntlm.unicode</TD>
  385. <TD>boolean</TD>
  386. <TD>
  387. Set this to "true" if the username or password may use
  388. Unicode UTF-8 encoded characters.  Default is "true".
  389. Currently has no effect.
  390. </TD>
  391. </TR>
  392.  
  393. <TR>
  394. <TD>mail.smtp.auth.ntlm.lmcompat</TD>
  395. <TD>int</TD>
  396. <TD>
  397. Sets the LM compatibility level, as described here:
  398. <A HREF="http://curl.haxx.se/rfc/ntlm.html#ntlmVersion2" TARGET="_top">
  399. http://curl.haxx.se/rfc/ntlm.html#ntlmVersion2</A>
  400. Defaults to "3".  Currently not used.
  401. </TD>
  402. </TR>
  403. -->
  404.  
  405. <TR>
  406. <TD>mail.smtp.submitter</TD>
  407. <TD>String</TD>
  408. <TD>The submitter to use in the AUTH tag in the MAIL FROM command.
  409. Typically used by a mail relay to pass along information about the
  410. original submitter of the message.
  411. See also the <A HREF="../../../../com/sun/mail/smtp/SMTPMessage.html#setSubmitter(java.lang.String)"><CODE>setSubmitter</CODE></A>
  412. method of <A HREF="../../../../com/sun/mail/smtp/SMTPMessage.html" title="class in com.sun.mail.smtp"><CODE>SMTPMessage</CODE></A>.
  413. Mail clients typically do not use this.
  414. </TD>
  415. </TR>
  416.  
  417. <TR>
  418. <TD>mail.smtp.dsn.notify</TD>
  419. <TD>String</TD>
  420. <TD>The NOTIFY option to the RCPT command.  Either NEVER, or some
  421. combination of SUCCESS, FAILURE, and DELAY (separated by commas).</TD>
  422. </TR>
  423.  
  424. <TR>
  425. <TD>mail.smtp.dsn.ret</TD>
  426. <TD>String</TD>
  427. <TD>The RET option to the MAIL command.  Either FULL or HDRS.</TD>
  428. </TR>
  429.  
  430. <TR>
  431. <TD>mail.smtp.allow8bitmime</TD>
  432. <TD>boolean</TD>
  433. <TD>
  434. If set to true, and the server supports the 8BITMIME extension, text
  435. parts of messages that use the "quoted-printable" or "base64" encodings
  436. are converted to use "8bit" encoding if they follow the RFC2045 rules
  437. for 8bit text.
  438. </TD>
  439. </TR>
  440.  
  441. <TR>
  442. <TD>mail.smtp.sendpartial</TD>
  443. <TD>boolean</TD>
  444. <TD>
  445. If set to true, and a message has some valid and some invalid
  446. addresses, send the message anyway, reporting the partial failure with
  447. a SendFailedException.  If set to false (the default), the message is
  448. not sent to any of the recipients if there is an invalid recipient
  449. address.
  450. </TD>
  451. </TR>
  452.  
  453. <TR>
  454. <TD>mail.smtp.sasl.realm</TD>
  455. <TD>String</TD>
  456. <TD>The realm to use with DIGEST-MD5 authentication.</TD>
  457. </TR>
  458.  
  459. <TR>
  460. <TD>mail.smtp.quitwait</TD>
  461. <TD>boolean</TD>
  462. <TD>
  463. If set to false, the QUIT command is sent
  464. and the connection is immediately closed.
  465. If set to true (the default), causes the transport to wait
  466. for the response to the QUIT command.
  467. </TD>
  468. </TR>
  469.  
  470. <TR>
  471. <TD>mail.smtp.reportsuccess</TD>
  472. <TD>boolean</TD>
  473. <TD>
  474. If set to true, causes the transport to include an
  475. <A HREF="../../../../com/sun/mail/smtp/SMTPAddressSucceededException.html" title="class in com.sun.mail.smtp"><CODE>SMTPAddressSucceededException</CODE></A>
  476. for each address that is successful.
  477. Note also that this will cause a
  478. <A HREF="../../../../javax/mail/SendFailedException.html" title="class in javax.mail"><CODE>SendFailedException</CODE></A>
  479. to be thrown from the
  480. <A HREF="../../../../com/sun/mail/smtp/SMTPTransport.html#sendMessage(javax.mail.Message, javax.mail.Address[])"><CODE>sendMessage</CODE></A>
  481. method of
  482. <A HREF="../../../../com/sun/mail/smtp/SMTPTransport.html" title="class in com.sun.mail.smtp"><CODE>SMTPTransport</CODE></A>
  483. even if all addresses were correct and the message was sent
  484. successfully.
  485. </TD>
  486. </TR>
  487.  
  488. <TR>
  489. <TD>mail.smtp.socketFactory</TD>
  490. <TD>SocketFactory</TD>
  491. <TD>
  492. If set to a class that implements the
  493. <code>javax.net.SocketFactory</code> interface, this class
  494. will be used to create SMTP sockets.  Note that this is an
  495. instance of a class, not a name, and must be set using the
  496. <code>put</code> method, not the <code>setProperty</code> method.
  497. </TD>
  498. </TR>
  499.  
  500. <TR>
  501. <TD>mail.smtp.socketFactory.class</TD>
  502. <TD>String</TD>
  503. <TD>
  504. If set, specifies the name of a class that implements the
  505. <code>javax.net.SocketFactory</code> interface.  This class
  506. will be used to create SMTP sockets.
  507. </TD>
  508. </TR>
  509.  
  510. <TR>
  511. <TD>mail.smtp.socketFactory.fallback</TD>
  512. <TD>boolean</TD>
  513. <TD>
  514. If set to true, failure to create a socket using the specified
  515. socket factory class will cause the socket to be created using
  516. the <code>java.net.Socket</code> class.
  517. Defaults to true.
  518. </TD>
  519. </TR>
  520.  
  521. <TR>
  522. <TD>mail.smtp.socketFactory.port</TD>
  523. <TD>int</TD>
  524. <TD>
  525. Specifies the port to connect to when using the specified socket
  526. factory.
  527. If not set, the default port will be used.
  528. </TD>
  529. </TR>
  530.  
  531. <TR>
  532. <TD>mail.smtp.ssl.enable</TD>
  533. <TD>boolean</TD>
  534. <TD>
  535. If set to true, use SSL to connect and use the SSL port by default.
  536. Defaults to false for the "smtp" protocol and true for the "smtps" protocol.
  537. </TD>
  538. </TR>
  539.  
  540. <TR>
  541. <TD>mail.smtp.ssl.checkserveridentity</TD>
  542. <TD>boolean</TD>
  543. <TD>
  544. If set to true, check the server identity as specified by
  545. <A HREF="http://www.ietf.org/rfc/rfc2595.txt" TARGET="_top">RFC 2595</A>.
  546. These additional checks based on the content of the server's certificate
  547. are intended to prevent man-in-the-middle attacks.
  548. Defaults to false.
  549. </TD>
  550. </TR>
  551.  
  552. <TR>
  553. <TD>mail.smtp.ssl.trust</TD>
  554. <TD>String</TD>
  555. <TD>
  556. If set, and a socket factory hasn't been specified, enables use of a
  557. <A HREF="../../../../com/sun/mail/util/MailSSLSocketFactory.html" title="class in com.sun.mail.util"><CODE>MailSSLSocketFactory</CODE></A>.
  558. If set to "*", all hosts are trusted.
  559. If set to a whitespace separated list of hosts, those hosts are trusted.
  560. Otherwise, trust depends on the certificate the server presents.
  561. </TD>
  562. </TR>
  563.  
  564. <TR>
  565. <TD>mail.smtp.ssl.socketFactory</TD>
  566. <TD>SSLSocketFactory</TD>
  567. <TD>
  568. If set to a class that extends the
  569. <code>javax.net.ssl.SSLSocketFactory</code> class, this class
  570. will be used to create SMTP SSL sockets.  Note that this is an
  571. instance of a class, not a name, and must be set using the
  572. <code>put</code> method, not the <code>setProperty</code> method.
  573. </TD>
  574. </TR>
  575.  
  576. <TR>
  577. <TD>mail.smtp.ssl.socketFactory.class</TD>
  578. <TD>String</TD>
  579. <TD>
  580. If set, specifies the name of a class that extends the
  581. <code>javax.net.ssl.SSLSocketFactory</code> class.  This class
  582. will be used to create SMTP SSL sockets.
  583. </TD>
  584. </TR>
  585.  
  586. <TR>
  587. <TD>mail.smtp.ssl.socketFactory.port</TD>
  588. <TD>int</TD>
  589. <TD>
  590. Specifies the port to connect to when using the specified socket
  591. factory.
  592. If not set, the default port will be used.
  593. </TD>
  594. </TR>
  595.  
  596. <TR>
  597. <TD>mail.smtp.ssl.protocols</TD>
  598. <TD>string</TD>
  599. <TD>
  600. Specifies the SSL protocols that will be enabled for SSL connections.
  601. The property value is a whitespace separated list of tokens acceptable
  602. to the <code>javax.net.ssl.SSLSocket.setEnabledProtocols</code> method.
  603. </TD>
  604. </TR>
  605.  
  606. <TR>
  607. <TD>mail.smtp.ssl.ciphersuites</TD>
  608. <TD>string</TD>
  609. <TD>
  610. Specifies the SSL cipher suites that will be enabled for SSL connections.
  611. The property value is a whitespace separated list of tokens acceptable
  612. to the <code>javax.net.ssl.SSLSocket.setEnabledCipherSuites</code> method.
  613. </TD>
  614. </TR>
  615.  
  616. <TR>
  617. <TD>mail.smtp.mailextension</TD>
  618. <TD>String</TD>
  619. <TD>
  620. Extension string to append to the MAIL command.
  621. The extension string can be used to specify standard SMTP
  622. service extensions as well as vendor-specific extensions.
  623. Typically the application should use the
  624. <A HREF="../../../../com/sun/mail/smtp/SMTPTransport.html" title="class in com.sun.mail.smtp"><CODE>SMTPTransport</CODE></A>
  625. method <A HREF="../../../../com/sun/mail/smtp/SMTPTransport.html#supportsExtension(java.lang.String)"><CODE>supportsExtension</CODE></A>
  626. to verify that the server supports the desired service extension.
  627. See <A HREF="http://www.ietf.org/rfc/rfc1869.txt" TARGET="_top">RFC 1869</A>
  628. and other RFCs that define specific extensions.
  629. </TD>
  630. </TR>
  631.  
  632. <TR>
  633. <TD>mail.smtp.starttls.enable</TD>
  634. <TD>boolean</TD>
  635. <TD>
  636. If true, enables the use of the <code>STARTTLS</code> command (if
  637. supported by the server) to switch the connection to a TLS-protected
  638. connection before issuing any login commands.  Note that an appropriate
  639. trust store must configured so that the client will trust the server's
  640. certificate.
  641. Defaults to false.
  642. </TD>
  643. </TR>
  644.  
  645. <TR>
  646. <TD>mail.smtp.starttls.required</TD>
  647. <TD>boolean</TD>
  648. <TD>
  649. If true, requires the use of the <code>STARTTLS</code> command.
  650. If the server doesn't support the STARTTLS command, or the command
  651. fails, the connect method will fail.
  652. Defaults to false.
  653. </TD>
  654. </TR>
  655.  
  656. <TR>
  657. <TD>mail.smtp.userset</TD>
  658. <TD>boolean</TD>
  659. <TD>
  660. If set to true, use the RSET command instead of the NOOP command
  661. in the <A HREF="../../../../javax/mail/Service.html#isConnected()"><CODE>isConnected</CODE></A> method.
  662. In some cases sendmail will respond slowly after many NOOP commands;
  663. use of RSET avoids this sendmail issue.
  664. Defaults to false.
  665. </TD>
  666. </TR>
  667.  
  668. <TR>
  669. <TD>mail.smtp.noop.strict</TD>
  670. <TD>boolean</TD>
  671. <TD>
  672. If set to true (the default), insist on a 250 response code from the NOOP
  673. command to indicate success.  The NOOP command is used by the
  674. <A HREF="../../../../javax/mail/Service.html#isConnected()"><CODE>isConnected</CODE></A> method to determine
  675. if the connection is still alive.
  676. Some older servers return the wrong response code on success, some
  677. servers don't implement the NOOP command at all and so always return
  678. a failure code.  Set this property to false to handle servers
  679. that are broken in this way.
  680. Normally, when a server times out a connection, it will send a 421
  681. response code, which the client will see as the response to the next
  682. command it issues.
  683. Some servers send the wrong failure response code when timing out a
  684. connection.
  685. Do not set this property to false when dealing with servers that are
  686. broken in this way.
  687. </TD>
  688. </TR>
  689.  
  690. </TABLE>
  691. <P>
  692. In general, applications should not need to use the classes in this
  693. package directly.  Instead, they should use the APIs defined by
  694. <code>javax.mail</code> package (and subpackages).  Applications should
  695. never construct instances of <code>SMTPTransport</code> directly.
  696. Instead, they should use the
  697. <code>Session</code> method <code>getTransport</code> to acquire an
  698. appropriate <code>Transport</code> object.
  699. <P>
  700. <strong>WARNING:</strong> The APIs unique to this package should be
  701. considered <strong>EXPERIMENTAL</strong>.  They may be changed in the
  702. future in ways that are incompatible with applications using the
  703. current APIs.
  704. <P>
  705.  
  706. <P>
  707. <DL>
  708. </DL>
  709. <HR>
  710.  
  711.  
  712. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  713. <A NAME="navbar_bottom"><!-- --></A>
  714. <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
  715. <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
  716. <TR>
  717. <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
  718. <A NAME="navbar_bottom_firstrow"><!-- --></A>
  719. <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  720.   <TR ALIGN="center" VALIGN="top">
  721.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  722.   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT>&nbsp;</TD>
  723.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
  724.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  725.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  726.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  727.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  728.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  729.   </TR>
  730. </TABLE>
  731. </TD>
  732. <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
  733. </EM>
  734. </TD>
  735. </TR>
  736.  
  737. <TR>
  738. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  739. &nbsp;<A HREF="../../../../com/sun/mail/pop3/package-summary.html"><B>PREV PACKAGE</B></A>&nbsp;
  740. &nbsp;<A HREF="../../../../com/sun/mail/util/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD>
  741. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  742.   <A HREF="../../../../index.html?com/sun/mail/smtp/package-summary.html" target="_top"><B>FRAMES</B></A>  &nbsp;
  743. &nbsp;<A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
  744. &nbsp;<SCRIPT type="text/javascript">
  745.   <!--
  746.   if(window==top) {
  747.     document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  748.   }
  749.   //-->
  750. </SCRIPT>
  751. <NOSCRIPT>
  752.   <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
  753. </NOSCRIPT>
  754.  
  755.  
  756. </FONT></TD>
  757. </TR>
  758. </TABLE>
  759. <A NAME="skip-navbar_bottom"></A>
  760. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  761.  
  762. <HR>
  763. Copyright &#169; 2009 <a href="http://www.sun.com">Sun Microsystems, Inc.</a>. All Rights Reserved.
  764. </BODY>
  765. </HTML>
  766.