Created
September 20, 2013 18:37
-
-
Save gusthavosouza/6641876 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mail; | |
import java.io.IOException; | |
import java.util.Properties; | |
import javax.mail.MessagingException; | |
import javax.mail.Session; | |
import javax.mail.internet.MimeMessage; | |
import javax.servlet.http.*; | |
public class MailHandlerServlet extends HttpServlet { | |
public void doGet(HttpServletRequest req, HttpServletResponse resp) | |
throws IOException { | |
Properties props = new Properties(); | |
Session session = Session.getDefaultInstance(props, null); | |
try { | |
MimeMessage message = new MimeMessage(session, req.getInputStream()); | |
System.out.println(message); | |
} catch (MessagingException e) { | |
// TODO Auto-generated catch block | |
e.printStackTrace(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment