Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Log JavaMailSenderImpl

i use Spring to send email in my application. I want to log the imap server operation, when i send emails. I try to implement log in my applicationContext.xml as follow:

<bean id="JavaMailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
    <property name="host" value="${smtpHost}" />
    <property name="port" value="${smtpPort}" />
    <property name="username" value="${userName}" />
    <property name="password" value="${password}" />
    <property name="session" ref="mailSession" />
    <props>
        <prop key="mail.debug">true</prop>
    </props>
</bean>

but doesn't works.Any suggest?

Thanks

like image 979
Riccardo Pedrinelli Avatar asked Sep 02 '25 02:09

Riccardo Pedrinelli


1 Answers

You're missing the outer property.

...
<property name="session" ref="mailSession">
<property name="javaMailProperties">
    <props>
        <prop key="mail.debug">true</prop>
    </props>
</property>
...
like image 115
Emerson Farrugia Avatar answered Sep 05 '25 00:09

Emerson Farrugia