View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.transport.email;
8   
9   import org.mule.api.MuleContext;
10  
11  import java.util.Properties;
12  
13  import javax.mail.URLName;
14  
15  /**
16   * This class just sets some extra SMTP properties so it works with GMail.
17   */
18  public class GmailSmtpConnector extends SmtpConnector
19  {
20  
21      public GmailSmtpConnector(MuleContext context)
22      {
23          super(context);
24      }
25      
26      @Override
27      protected void extendPropertiesForSession(Properties global, Properties local, URLName url) 
28      {
29          super.extendPropertiesForSession(global, local, url);
30  
31          local.setProperty("mail.smtp.starttls.enable", "true");
32          local.setProperty("mail.smtp.auth", "true");
33          local.setProperty("mail.smtps.starttls.enable", "true");
34          local.setProperty("mail.smtps.auth", "true");
35      }
36  }
37  
38