How to create javax.mail.Session in spring config
<pre><code>    Session session = Session.getDefaultInstance(props,
        new javax.mail.Authenticator() {
            protected PasswordAuthentication getPasswordAuthentication() {
                return new PasswordAuthentication("example@gmail.com","password");
            }
        });
</code></pre>

<p>I just want to have a spring bean configuration for this session. How to create the javax.mail.Authenticator() bean in spring xml??</p>