JavaMail providers

JavaMail is extensible which means that when new protocols are developed, providers for those protocols can be added to a system and used by preexisting JavaMail enabled applications. Applications can detect which providers are available to them via the Provider Registry.

The providers that come with the JavaMail reference implementation are listed in javamail.default.providers. If you add a package containing a new provider, it should include a javamail.providers file in its META-INF directory.

To list the available providers on your system:

import javax.mail.*;
class ListProviders
{
   public static void main(String[] args)
   {
java.util.Properties properties = 
   System.getProperties();
Session session = Session.getInstance(properties,
   null);
Provider[] providers = session.getProviders();
for (int i = 0; i < providers.length; ++i)
   {
   System.out.println(providers[i]);
   }
}