Featured Post

Spring Mail-Sending program dependency injection

In the earlier post mail sending using spring framework xml would be as followes




&?xml version="1.0" encoding="UTF-8"?&

&!--
Document : MailSend.xml
Created on : July 5, 2010, 3:53 PM
Author : root
Description:
Purpose of the document follows.
--&
&beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"&


&bean id="order" class="Order"&
&property name="customer" ref="customer"&&/property&
&property name="orderNumber" value="ABCREF-1234"&&/property&
&/bean&
&bean id="customer" class="Customer"&
&property name="email" value="test2test.com"&&/property&
&property name="firstName" value="TEST"&&/property&
&property name="lastName" value="TEST"&&/property&
&/bean&
&bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl"&
&property name="host" value="smtp.test.com"&&/property&
&property name="port" value="25"&&/property&
&property name="username" value="venkat@test.com"&&/property&
&property name="password" value="xxxx"&&/property&
&property name="javaMailProperties"&
&props&
&prop key="mail.smtp.auth"&true&/prop&
&prop key="mail.smtp.starttls.enable"&true&/prop&
&/props&
&/property&

&/bean&
&bean id="mailMessage" class="org.springframework.mail.SimpleMailMessage"&
&property name="from" value="venkata.s@test.com"&&/property&
&property name="subject" value="Status Report"&&/property&

&/bean&
&bean id="orderManager" class="com.myapp.struts.OrderManagerImpl"&
&property name="mailSender" ref="mailSender"&&/property&
&property name="message" ref="mailMessage"&&/property&
&/bean&
&/beans&


Note : here replace & with < and > so that xml is valid xml . this is for the blogger posting conventiom I replaced < and > with &





Enter you DOB ,Time and Place

SEO Schemes

Comments

Popular posts from this blog

[Inside AdSense] Understanding your eCPM (effective cost per thousand impress...