View Javadoc

1   /*
2    * $Id: GmailSmtpConnector.java 19191 2010-08-25 21:05:23Z tcarlson $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.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.transport.email;
12  
13  import org.mule.api.MuleContext;
14  
15  import java.util.Properties;
16  
17  import javax.mail.URLName;
18  
19  /**
20   * This class just sets some extra SMTP properties so it works with GMail.
21   */
22  public class GmailSmtpConnector extends SmtpConnector
23  {
24  
25      public GmailSmtpConnector(MuleContext context)
26      {
27          super(context);
28      }
29      
30      @Override
31      protected void extendPropertiesForSession(Properties global, Properties local, URLName url) 
32      {
33          super.extendPropertiesForSession(global, local, url);
34  
35          local.setProperty("mail.smtp.starttls.enable", "true");
36          local.setProperty("mail.smtp.auth", "true");
37          local.setProperty("mail.smtps.starttls.enable", "true");
38          local.setProperty("mail.smtps.auth", "true");
39      }
40  }
41  
42