props.put("mail.smtp.provider.class", MockEmailTransport.class.getName());
props.put("mail.smtp.class", MockEmailTransport.class.getName());
props.put("mail.smtp.provider.vendor", "test");
props.put("mail.smtp.provider.version", "0.0.0");
Provider provider = new Provider(Type.TRANSPORT, "smtp", MockEmailTransport.class.getName(), "test", "1.0");
Session mailSession = Session.getDefaultInstance(props);
SimpleNamingContextBuilder builder = null;
try {
mailSession.setProvider(provider);
builder = SimpleNamingContextBuilder.emptyActivatedContextBuilder();