js|servlet| email I'm here with version 1.2, add the related package (jar file) to the Classpath
Second: The program is very simple, do not need us to consider a lot of strata of things, because the API to help us do these things, the following is a Simple mail servlet: (for familiar people, I am afraid is a simple servlet)
Import java.io.*;
Import javax.servlet.*;
Import javax.servlet.http.*;
Import sun.net.smtp.*;
public class Sendmailservlet extends HttpServlet {
public static String Mail_from = ' from ';
public static String mail_to = ' to ';
public static String Mail_subject = "SUBJECT";
public static String mail_body = ' body ';
public static String Mail_host = "Mailhost";
public void Doget (HttpServletRequest req, HttpServletResponse resp) throws Servletexception, IOException
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.