code: public Session createMailSession(final String host, final int port, final String username, final String password) {
  		Properties props = transportStrategy.generateProperties();
  		props.put(transportStrategy.propertyNameHost(), host);
  		props.put(transportStrategy.propertyNamePort(), String.valueOf(port));
  
  		if (username != null) {
  			props.put(transportStrategy.propertyNameUsername(), username);
  		}
  
  		if (password != null) {
  			props.put(transportStrategy.propertyNameAuthenticate(), "true");
  			return Session.getInstance(props, new Authenticator() {
  				@Override
  				protected PasswordAuthentication getPasswordAuthentication() {
  					return new PasswordAuthentication(username, password);
  				}
  			});
  		} else {
  			return Session.getInstance(props);
  		}
  	}
docs: Actually instantiates and configures the {@link Session} instance. Delegates resolving transport protocol specific properties to the
  {@link #transportStrategy} in two ways:
  <ol>
  <li>request an initial property list which the strategy may pre-populate</li>
  <li>by requesting the property names according to the respective transport protocol it handles (for the host property name it would
  be <em>"mail.smtp.host"</em> for SMTP and <em>"mail.smtps.host"</em> for SMTPS)</li>
  </ol>
  
  @param host The address URL of the SMTP server to be used.
  @param port The port of the SMTP server.
  @param username An optional username, may be <code>null</code>.
  @param password An optional password, may be <code>null</code>.
  @return A fully configured <code>Session</code> instance complete with transport protocol settings.
  @see TransportStrategy#generateProperties()
  @see TransportStrategy#propertyNameHost()
  @see TransportStrategy#propertyNamePort()
  @see TransportStrategy#propertyNameUsername()
  @see TransportStrategy#propertyNameAuthenticate()