can anybody help me , how to send the mail using gwt and spring.
i tried but getting error as :
no source code is available for type org.springframework.core.io.Resource,did you forget the inherit a required module?
my code is this:
Client side:
Resource res = new ClassPathResource("classpath:context/applicationContext.xml");
BeanFactory factory = new XmlBeanFactory(res);
Object o = factory.getBean("id2");
GreetingServiceImpl mail = (GreetingServiceImpl)o;
//String password =result.getPassword();
try {
mail.sendMail("fromvinu1","fromvinu1","forgotpassword",password);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Server side:
private MailSender mail;
public void setMail(MailSender mail)
{
this.mail = mail;
}
public String sendMail(String from, String to,String subject,String msg) {
SimpleMailMessage message = new SimpleMailMessage();
message.setFrom(from);
message.setTo(to);
message.setSubject(subject);
message.setText(msg);
mail.send(message);
System.out.println("Mail Sent Successfully...!");
// return UserInfo;
return msg;
XML file:
<bean id="id1" class="org.springframework.mail.javamail.JavaMailSenderImpl">
<property name="port" value="465" />
<property name="username" value="fromvinu1" />
<property name="password" value="********" />
<property name="javaMailProperties">
<props>
<prop key="mail.smtp.auth">true</prop>
<prop key="mail.smtp.socketFactory.class">javax.net.ssl.SSLSocketFactory</prop>
<prop key="mail.smtp.socketFactory.port">465</prop>
<prop key="mail.debug">true</prop>
<prop key="mail.smtp.starttls.enable">true</prop>
</props>
</property>
</bean>
<bean id="id2" class="package.GreetingServiceImpl">
<property name="mail" ref="id1" />
</bean>