title: Springframework JavaMailSender doesn't work anymore on OpenJDK1.7
body: <p>I've a EmailService Class like this: </p>
  
  <pre><code>package com.helios.service.mail;
  
  import java.util.ArrayList;
  import java.util.List;
  
  import javax.mail.MessagingException;
  import javax.mail.NoSuchProviderException;
  import javax.mail.internet.AddressException;
  import javax.mail.internet.MimeMessage;
  
  import org.apache.log4j.Logger;
  import org.springframework.stereotype.Service;
  
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.mail.MailException;
  import org.springframework.mail.javamail.MimeMessageHelper;
  import org.springframework.mail.javamail.JavaMailSender;
  
  import scala.actors.threadpool.Arrays;
  import com.helios.util.PropertiesUtil;
  
  /**
   * The e-mail service contains all you need in order to send E-Mails 
   * successfully
   */
  @Service
  public class EmailService
  {
      // ------------------------------------------------------------------------
      // members
  // ------------------------------------------------------------------------
  
  // log4j...
  static final Logger logger = Logger.getLogger(EmailService.class);
  
  @Autowired
  private JavaMailSender mailSender;
  
  // ------------------------------------------------------------------------
  // public usage
  // ------------------------------------------------------------------------
  
  /**
   * Send an Email the cool way!
   * @param recipients
   * @param subject
   * @param text
   * @param html
   */
  public void sendEmail(List&lt;String&gt; recipients,String subject,
          String text,boolean html)
      throws NoSuchProviderException,AddressException,MessagingException {
  
      try {
          MimeMessage mimeMessage = mailSender.createMimeMessage();
          MimeMessageHelper messageHelper = new MimeMessageHelper(mimeMessage);
          messageHelper.setFrom(PropertiesUtil.getProperty("mail.defaultsender"));
          messageHelper.setTo(recipients.toArray(new String[recipients.size()]));
          messageHelper.setSubject(subject);
          messageHelper.setText(text, html);
          mailSender.send(mimeMessage);
      }
      catch (MailException ex) {
          logger.error("Fail: "+ex.getMessage());
      }
  
  }
  // ------------------------------------------------------------------------
  // private usage
  // ------------------------------------------------------------------------
  
  
  // ------------------------------------------------------------------------
  // GETTER &amp; SETTER
  // ------------------------------------------------------------------------
  }
  </code></pre>
  
  <p>A bean is used to configure the mailSender to send trough Amazon SES</p>
  
  <pre><code>  &lt;bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl"&gt;
      &lt;property name="host" value="email-smtp.us-east-1.amazonaws.com" /&gt;
      &lt;property name="port" value="465" /&gt;
      &lt;property name="protocol" value="smtps" /&gt;
      &lt;property name="username" value="..." /&gt;
      &lt;property name="password" value="..." /&gt;
      &lt;property name="javaMailProperties"&gt;
          &lt;props&gt;
              &lt;prop key="mail.smtps.auth"&gt;true&lt;/prop&gt;
              &lt;prop key="mail.smtp.ssl.enable"&gt;true&lt;/prop&gt;
              &lt;prop key="mail.transport.protocol"&gt;smtps&lt;/prop&gt;
              &lt;prop key="mail.debug"&gt;true&lt;/prop&gt;
          &lt;/props&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Now, if i run the sendEmail method under JDK1.6 it will work fine. If i run absolutly same code on 1.7 it won't work. </p>
  
  <p>I can't find out where the problem is. Do you have any idea?</p>
  
  <p>Thanks!</p>