Get a Transport object that implements this user's desired Transport protcol. The mail.transport.protocol property specifies the desired protocol. If an appropriate Transport object cannot be obtained, MessagingException is thrown. @return a Transport object @exception NoSuchProvider
()
| 668 | * @exception NoSuchProviderException If the provider is not found. |
| 669 | */ |
| 670 | public Transport getTransport() throws NoSuchProviderException { |
| 671 | String prot = getProperty("mail.transport.protocol"); |
| 672 | if (prot != null) |
| 673 | return getTransport(prot); |
| 674 | // if the property isn't set, use the protocol for "rfc822" |
| 675 | prot = (String)addressMap.get("rfc822"); |
| 676 | if (prot != null) |
| 677 | return getTransport(prot); |
| 678 | return getTransport("smtp"); // if all else fails |
| 679 | } |
| 680 | |
| 681 | /** |
| 682 | * Get a Transport object that implements the specified protocol. |
no test coverage detected