Since my last update of my WordPress blog it was horrible slow. My mobile phone was not able to load the blog anymore, my computer needs something arround one or one and a half minutes to load the next page, on the blog and in the admin dashboard too. I asked myself why.Read More
Monat: August 2011
Send Email by Spring batch with variable attachments
It is very simple to send an Email with attachments by Spring batch framework.
Firstly you need 3 beans for handling the email:
– The first bean initializes JavaMail and sets all needed properties
<bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
<property name="host" value="smtp.yourEmailDomain.de"/>
<property name="port" value="25"/>
<property name="username" value="yourUserName"/>
<property name="password" value="yourPassword"/>
<property name="javaMailProperties">
<props>
<prop key="mail.smtp.auth">true</prop>
</props>
</property>
</bean>
<property name="host" value="smtp.yourEmailDomain.de"/>
<property name="port" value="25"/>
<property name="username" value="yourUserName"/>
<property name="password" value="yourPassword"/>
<property name="javaMailProperties">
<props>
<prop key="mail.smtp.auth">true</prop>
</props>
</property>
</bean>