I need to send e-mails from my application that is deployed on Weblogic 10.0. I try to put mail session properties on server side. Properties like mail.host
or mail.debug
work OK. But how do I configure password? Now I have it in spring configuration file:
<bean id="mailSender"
class="org.springframework.mail.javamail.JavaMailSenderImpl">
<property name="session" ref="mailSession"/>
<property name="username" value="myLogin"></property>
<property name="password" value="myPassword"></property>
</bean>
<bean id="alertsMailSession" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>mail/mainSession</value>
</property>
<property name="resourceRef">
<value>true</value>
</property>
</bean>
I tried mail.smtp.password
property, but it doesn t work. Sun documentation says there is no property for password (although I ve seen mail.smtp.password
in some examples). So how should I do it? Is it possible to have login/password information configured on server, not in application?
EDIT
All of you suggest some properties files. I don t want them. I have a mail session on my application server. I get this session by JNDI. I can configure there host to use to send mails and so on. But I can t put there password. It doesn t work. I want all of the configuration to be done by Weblogic console. How to achieve that?