View Javadoc

1   /*
2    * $$Id: SmtpConnector.java 12221 2008-07-01 20:04:09Z dfeist $$
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.example.bookstore.utils;
12  
13  import java.util.Properties;
14  
15  import javax.mail.URLName;
16  
17  /**
18   * This class just sets some extra SMTP properties so it works with GMail.
19   */
20  public class SmtpConnector extends org.mule.transport.email.SmtpsConnector
21  {
22  
23      @Override
24      protected void extendPropertiesForSession(Properties global, Properties local, URLName url) {
25          super.extendPropertiesForSession(global, local, url);
26  
27          local.setProperty("mail.smtp.starttls.enable", "true");
28          local.setProperty("mail.smtp.auth", "true");
29          local.setProperty("mail.smtps.starttls.enable", "true");
30          local.setProperty("mail.smtps.auth", "true");
31      }
32  }