jsp中SimpleEmail实现邮件发送功能

作者:袖梨 2022-06-29
 代码如下 复制代码
<%@ page import="org.apache.commons.mail.SimpleEmail"%>
<%
SimpleEmail email = new SimpleEmail();
email.setHostName("hostname");
email.addTo("TO", "Balu, Rajesh");
email.setFrom("FROM", "Balu, Rajesh");
email.setSubject("Test message");
email.setMsg("This is a simple test of commons-email");
email.send();
%>

相关文章

精彩推荐