Add javadocs, code clean-up
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@345617 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0dc83a4cd2
commit
ad085dc742
@ -1,15 +1,7 @@
|
||||
package org.apache.maven.announcement;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.Writer;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.apache.commons.net.smtp.SMTPClient;
|
||||
import org.apache.commons.net.smtp.SMTPReply;
|
||||
import org.apache.commons.net.smtp.SimpleSMTPHeader;
|
||||
|
||||
/* ====================================================================
|
||||
* Copyright 2004 The Apache Software Foundation.
|
||||
* Copyright 2004-2005 The Apache Software Foundation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -25,17 +17,35 @@ import org.apache.commons.net.smtp.SimpleSMTPHeader;
|
||||
* ====================================================================
|
||||
*/
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.Writer;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.apache.commons.net.smtp.SMTPClient;
|
||||
import org.apache.commons.net.smtp.SMTPReply;
|
||||
import org.apache.commons.net.smtp.SimpleSMTPHeader;
|
||||
|
||||
/**
|
||||
* Send an email message using Jakarta Commons Net
|
||||
*
|
||||
* @author Felipe Leme
|
||||
*
|
||||
* @version $Id$
|
||||
*/
|
||||
public class MailUtils
|
||||
{
|
||||
/** E-mail address separator. */
|
||||
private static final String ADDRESS_SEPARATOR = ",";
|
||||
|
||||
/**
|
||||
* Send an email message.
|
||||
*
|
||||
* @param server The server
|
||||
* @param client The client
|
||||
* @param from from e-mail address
|
||||
* @param to to e-mail address
|
||||
* @param subject e-mail subject
|
||||
* @param msg e-mail body
|
||||
* @return "ok" if everything is fine, the Exception error message otherwise
|
||||
*/
|
||||
public static String sendMail(String server, String client,
|
||||
String from, String to, String subject, String msg)
|
||||
{
|
||||
@ -90,7 +100,7 @@ public class MailUtils
|
||||
smtpClient.addRecipient(st.nextToken().trim());
|
||||
}
|
||||
|
||||
System.out.println("Sending message from [" + from + "] to ["
|
||||
System.out.println("Sending message from [" + from + "] to ["
|
||||
+ to + "]");
|
||||
|
||||
// Use the SimpleSMTPHeader class to build the header
|
||||
@ -126,7 +136,7 @@ public class MailUtils
|
||||
|
||||
// everything is fine
|
||||
return "ok";
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
@ -134,4 +144,4 @@ public class MailUtils
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user