AnsweredAssumed Answered

sending Email to invited users via gmail

Question asked by tejaswini on Mar 3, 2010
Latest reply on Sep 19, 2010 by chetna
hi there…
   i want to send the mails to the invited users on particular spaces via gmail server.
   i am doing something as
   1) adding following code to the reository.properties

   # Email configuration
mail.host = smtp.gmail.com
mail.port = 465
mail.transport.protocol = smtp
mail.username =xxxx@gmail.com
mail.password=xxxx
mail.smtp.auth = true
mail.smtp.socketFactory.port = 465
mail.smtp.socketFactory.class = javax.net.ssl.SSLSocketFactory
mail.smtp.socketFactory.fallback = false
mail.smtp.timeout = 25000
mail.smtp.starttls.enable = true
mail.encoding=UTF-8

and

2) to core-services-context.xml
<bean id="mailService" class="org.springframework.mail.javamail.JavaMailSenderImpl">
  <property name="host">
    <value>${mail.host}</value>
  </property>
  <property name="port">
    <value>${mail.port}</value>
  </property>                                          
  <property name="protocol">                           
    <value>${mail.transport.protocol}</value>
  </property>
  <property name="username">
    <value>${mail.username}</value>
  </property>
  <property name="password">
    <value>${mail.password}</value>
  </property>
  <property name="defaultEncoding">
    <value>${mail.encoding}</value>
  </property>
  <property name="javaMailProperties">
    <props>
      <prop key="mail.smtp.auth">${mail.smtp.auth}</prop>
      <prop key="mail.smtp.socketFactory.port">${mail.smtp.socketFactory.port}</prop>
      <prop key="mail.smtp.socketFactory.class">${mail.smtp.socketFactory.class}</prop>
      <prop key="mail.smtp.socketFactory.fallback">${mail.smtp.socketFactory.fallback}</prop>
      <prop key="mail.smtp.timeout">${mail.smtp.timeout}</prop>
    </props>
  </property>
</bean>

after restarting the server whn i invite the user and try to send the mail on the right email address i got on console
ERROR[web.bean.TemplateMailHelperBean] Failed to send the email at xxxx address.
org.springframework.mail.MailSendException details(1)are failed message 1:
javax.mail.MessagingException:IO Exception while sending message;
nested exception is:
     java.io.UnSupportedEncodingException:${mail.encoding} at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:625)…….
and something like that….
do anybody have the solution to this problem????

thanks in advance

Outcomes