library names now start with wamblee- to make them unique.
[utils] / crawler / kiss / src / org / wamblee / crawler / kiss / notification / MailServer.java
index 1fe66dde36b45438e3de41a94c6b90490d126da7..917f6287b14c8a238afc5463efae33f0f3a68054 100644 (file)
@@ -15,32 +15,44 @@ import org.apache.commons.mail.EmailException;
  * Mail server.
  */
 public class MailServer {
-    
-    private String _host; 
+
+    private String _host;
+
     private int _port;
+
     private String _username;
+
     private String _password;
 
     /**
-     * Constructs the mail server interface. 
-     * @param aHost Host name of the SMTP server.
-     * @param aPort Port name of the SMTP server.
-     * @param aUsername Username to use for authentication or null if no authentication is 
-     *   required. 
-     * @param aPassword Password to use for authentication or null if no authenticatio is 
-     *   required. 
+     * Constructs the mail server.
+     * 
+     * @param aHost
+     *            Host name of the SMTP server.
+     * @param aPort
+     *            Port name of the SMTP server.
+     * @param aUsername
+     *            Username to use for authentication or null if no
+     *            authentication is required.
+     * @param aPassword
+     *            Password to use for authentication or null if no authenticatio
+     *            is required.
      */
-    public MailServer(String aHost, int aPort, String aUsername, String aPassword) {
+    public MailServer(String aHost, int aPort, String aUsername,
+            String aPassword) {
         _host = aHost;
         _port = aPort;
         _username = aUsername;
         _password = aPassword;
     }
-    
+
     /**
-     * Sends an e-mail. 
-     * @param aMail Mail to send. 
-     * @throws EmailException In case of problems sending the mail. 
+     * Sends an e-mail.
+     * 
+     * @param aMail
+     *            Mail to send.
+     * @throws EmailException
+     *             In case of problems sending the mail.
      */
     public void send(Email aMail) throws EmailException {
         Properties props = new Properties();
@@ -48,7 +60,8 @@ public class MailServer {
         props.put("mail.smtp.host", _host);
         props.put("mail.smtp.port", "" + _port);
 
-        Session mailSession = Session.getInstance(props, new UsernamePasswordAuthenticator(_username, _password));
+        Session mailSession = Session.getInstance(props,
+                new UsernamePasswordAuthenticator(_username, _password));
         aMail.setMailSession(mailSession);
         aMail.send();
     }