20 个解决方案
#1
呵呵,帮你up....
#2
获得要发的email地址
触发发送
触发发送
#3
哈哈自已动手去找吧网上多的是
#4
^_^,我看了好多,但是还是没有弄好
#5
JAVAMAIL解压后,将路径加进CLASSPATH,还需要做啥准备,才可以调用它的方法吗
#6
很简单的,邮件列表我就做过了,字段就没,不过,你做过个触发不就行了,用javamail作,你先要去java.sun.com下载javamail和jaf包,解压,把和mail.jar
和activation.jar加到classpath中去,然后就是用javamail的api编程,看看javamail api的doc很简单的
和activation.jar加到classpath中去,然后就是用javamail的api编程,看看javamail api的doc很简单的
#7
HELP!现在是JAVA我可以搞定,但是JSP搞不定
它说我ATTRIBUTE NOT VALUE
它说我ATTRIBUTE NOT VALUE
#8
<%@ page
import=" javax.mail.*, javax.mail.internet.*, javax.activation.*,java.util.*"
%>
<html>
<head>
<TITLE>JSP meets JavaMail, what a sweet combo.</TITLE>
</HEAD>
<BODY>
<%
try{
String host = "smtp.163.net";
String from="rain_voice@163.net";
String to=request.getParameter("to");
String subject=request.getParameter("subject");
String text=request.getParameter("text");
String username = "name";
String password = "password";
Properties props = new Properties();
props.put("mail.smtp.host", host);
props.put("mail.smtp.auth", "true");
Session session = Session.getDefaultInstance(props);
session.setDebug(true);
MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress(from));
message.setRecipient(Message.RecipientType.TO, new InternetAddress(to));
message.setSubject(subject);
message.setSentDate(new Date());
message.setText(text);
message.saveChanges();
Transport transport = session.getTransport("smtp");
transport.connect(host, username, password);
transport.sendMessage(message, message.getAllRecipients());
transport.close();
%>
<P>Your mail has been sent.</P>
<%
}
catch(MessagingException m)
{
out.println(m.toString());
}
%>
</BODY>
</HTML>
看看,错在那里
import=" javax.mail.*, javax.mail.internet.*, javax.activation.*,java.util.*"
%>
<html>
<head>
<TITLE>JSP meets JavaMail, what a sweet combo.</TITLE>
</HEAD>
<BODY>
<%
try{
String host = "smtp.163.net";
String from="rain_voice@163.net";
String to=request.getParameter("to");
String subject=request.getParameter("subject");
String text=request.getParameter("text");
String username = "name";
String password = "password";
Properties props = new Properties();
props.put("mail.smtp.host", host);
props.put("mail.smtp.auth", "true");
Session session = Session.getDefaultInstance(props);
session.setDebug(true);
MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress(from));
message.setRecipient(Message.RecipientType.TO, new InternetAddress(to));
message.setSubject(subject);
message.setSentDate(new Date());
message.setText(text);
message.saveChanges();
Transport transport = session.getTransport("smtp");
transport.connect(host, username, password);
transport.sendMessage(message, message.getAllRecipients());
transport.close();
%>
<P>Your mail has been sent.</P>
<%
}
catch(MessagingException m)
{
out.println(m.toString());
}
%>
</BODY>
</HTML>
看看,错在那里
#9
Java mail不如sun.net.smtp好用,你可以这样试试:
import sun.net.smtp.*;
...
host="your host name";
from="aaa@aaa.com";
to=rs.getString("bbb@bbb.com");
SmtpClient smtp=new SmtpClient(host);
smtp.from(from);
smtp.to(to);
PrintStream msg=smtp.startMessage();
msg.println("From: "+from);
msg.println("To: "+to);
msg.println();
msg.println("this is a mail test.");
msg.close();
smtp.closeServer();
...
import sun.net.smtp.*;
...
host="your host name";
from="aaa@aaa.com";
to=rs.getString("bbb@bbb.com");
SmtpClient smtp=new SmtpClient(host);
smtp.from(from);
smtp.to(to);
PrintStream msg=smtp.startMessage();
msg.println("From: "+from);
msg.println("To: "+to);
msg.println();
msg.println("this is a mail test.");
msg.close();
smtp.closeServer();
...
#10
有什么出错提示啊?
#11
有什么出错提示啊?
#12
org.apache.jasper.compiler.ParseException: /online/sendmail.jsp(2,5) Attribute ???? has no value
at org.apache.jasper.compiler.JspReader.parseAttributeValue(JspReader.java:563)
at org.apache.jasper.compiler.JspReader.parseTagAttributes(JspReader.java:681)
at org.apache.jasper.compiler.ParserController.figureOutJspDocument(ParserController.java:265)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:194)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:210)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:552)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:177)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:189)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1017)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1115)
at java.lang.Thread.run(Thread.java:536)
at org.apache.jasper.compiler.JspReader.parseAttributeValue(JspReader.java:563)
at org.apache.jasper.compiler.JspReader.parseTagAttributes(JspReader.java:681)
at org.apache.jasper.compiler.ParserController.figureOutJspDocument(ParserController.java:265)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:194)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:210)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:552)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:177)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:189)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1017)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1115)
at java.lang.Thread.run(Thread.java:536)
#13
<%@ page contentType="text/html; charset=GBK" %>
<%@ page language="java" import="java.util.*,javax.mail.*,javax.mail.internet.*"%>
<%
try{
String host = "smtp.263.net";
String from = "...";
String to = "...";
String username = "...";
String password = "....";
// Get system properties
// Properties props = System.getProperties(); 很多例子中是这样的,其实下面这句更好,可以用在applet中
Properties props = new Properties();
// Setup mail server
props.put("mail.smtp.host", host);
props.put("mail.smtp.auth", "true"); //这样才能通过验证
// Get session
Session sessionDLT = Session.getDefaultInstance(props);
// watch the mail commands go by to the mail server
sessionDLT.setDebug(true);
// Define message
MimeMessage message = new MimeMessage(sessionDLT);
message.setFrom(new InternetAddress(from));
message.addRecipient(Message.RecipientType.TO,
new InternetAddress(to));
message.setSubject("Hello JavaMail");
message.setText("Welcome to JavaMail");
// Send message
message.saveChanges();
Transport transport = sessionDLT.getTransport("smtp");
transport.connect(host, username, password);
transport.sendMessage(message, message.getAllRecipients());
transport.close();
out.println("您的邮件发送成功!");
}catch(Exception e){
out.println(e.getMessage());
}
%>
<%@ page language="java" import="java.util.*,javax.mail.*,javax.mail.internet.*"%>
<%
try{
String host = "smtp.263.net";
String from = "...";
String to = "...";
String username = "...";
String password = "....";
// Get system properties
// Properties props = System.getProperties(); 很多例子中是这样的,其实下面这句更好,可以用在applet中
Properties props = new Properties();
// Setup mail server
props.put("mail.smtp.host", host);
props.put("mail.smtp.auth", "true"); //这样才能通过验证
// Get session
Session sessionDLT = Session.getDefaultInstance(props);
// watch the mail commands go by to the mail server
sessionDLT.setDebug(true);
// Define message
MimeMessage message = new MimeMessage(sessionDLT);
message.setFrom(new InternetAddress(from));
message.addRecipient(Message.RecipientType.TO,
new InternetAddress(to));
message.setSubject("Hello JavaMail");
message.setText("Welcome to JavaMail");
// Send message
message.saveChanges();
Transport transport = sessionDLT.getTransport("smtp");
transport.connect(host, username, password);
transport.sendMessage(message, message.getAllRecipients());
transport.close();
out.println("您的邮件发送成功!");
}catch(Exception e){
out.println(e.getMessage());
}
%>
#14
可以了嘛
#15
weidegong(weidegong:
在你产这个程序中smtp sever设为smtp.263.net
可是form只能是XXX@263.net的形式时,邮件才能发送成功,这是怎么回事?
怎样才能解决这问题?
谢谢!!
在你产这个程序中smtp sever设为smtp.263.net
可是form只能是XXX@263.net的形式时,邮件才能发送成功,这是怎么回事?
怎样才能解决这问题?
谢谢!!
#16
To ajzhn(梦醉生):
这个很简单了。String host = "smtp.263.net";把这句改一下,你用哪个Email发送邮件,就用哪个的smtp服务器,比如,如果你使用新浪的邮箱来发送,那么String host = "smtp.sina.com.cn";
......weidegong慢慢地转过身去,自言自语道:不会吧,这位老兄居然连邮件发送的常识都不懂,还想发邮件?呵呵呵。。。
这个很简单了。String host = "smtp.263.net";把这句改一下,你用哪个Email发送邮件,就用哪个的smtp服务器,比如,如果你使用新浪的邮箱来发送,那么String host = "smtp.sina.com.cn";
......weidegong慢慢地转过身去,自言自语道:不会吧,这位老兄居然连邮件发送的常识都不懂,还想发邮件?呵呵呵。。。
#17
司仪:食神首先品尝的就是大龙凤酒楼的总厨,戴龙师傅的“皇帝炒饭”。
食神:好!居然能够把米放在基围虾里面来蒸熟, 再用整只*鲍鱼榨汁,加上*“官燕”来炒,表面上看起来呢是平凡无奇的炒饭, 其实是精雕细琢,高深莫测,不愧是有“炒王”的称号。
(戴师傅得意的笑)
可惜,水分太多,饭粒太软影响口感,没想到你连炒饭最基本的常识都不懂--要用隔夜饭来炒啊,炒王。零分!
戴师傅:啊?!
食神:好!居然能够把米放在基围虾里面来蒸熟, 再用整只*鲍鱼榨汁,加上*“官燕”来炒,表面上看起来呢是平凡无奇的炒饭, 其实是精雕细琢,高深莫测,不愧是有“炒王”的称号。
(戴师傅得意的笑)
可惜,水分太多,饭粒太软影响口感,没想到你连炒饭最基本的常识都不懂--要用隔夜饭来炒啊,炒王。零分!
戴师傅:啊?!
#18
呵呵,竟然跑来我的帖子灌水了,打!!!!
#19
To rain_ok(雨) ;
敢,看我不收拾你才怪^_^
敢,看我不收拾你才怪^_^
#20
哈哈,幸亏你上班不可以QQ,否则(怕怕)^_^
#21
#1
呵呵,帮你up....
#2
获得要发的email地址
触发发送
触发发送
#3
哈哈自已动手去找吧网上多的是
#4
^_^,我看了好多,但是还是没有弄好
#5
JAVAMAIL解压后,将路径加进CLASSPATH,还需要做啥准备,才可以调用它的方法吗
#6
很简单的,邮件列表我就做过了,字段就没,不过,你做过个触发不就行了,用javamail作,你先要去java.sun.com下载javamail和jaf包,解压,把和mail.jar
和activation.jar加到classpath中去,然后就是用javamail的api编程,看看javamail api的doc很简单的
和activation.jar加到classpath中去,然后就是用javamail的api编程,看看javamail api的doc很简单的
#7
HELP!现在是JAVA我可以搞定,但是JSP搞不定
它说我ATTRIBUTE NOT VALUE
它说我ATTRIBUTE NOT VALUE
#8
<%@ page
import=" javax.mail.*, javax.mail.internet.*, javax.activation.*,java.util.*"
%>
<html>
<head>
<TITLE>JSP meets JavaMail, what a sweet combo.</TITLE>
</HEAD>
<BODY>
<%
try{
String host = "smtp.163.net";
String from="rain_voice@163.net";
String to=request.getParameter("to");
String subject=request.getParameter("subject");
String text=request.getParameter("text");
String username = "name";
String password = "password";
Properties props = new Properties();
props.put("mail.smtp.host", host);
props.put("mail.smtp.auth", "true");
Session session = Session.getDefaultInstance(props);
session.setDebug(true);
MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress(from));
message.setRecipient(Message.RecipientType.TO, new InternetAddress(to));
message.setSubject(subject);
message.setSentDate(new Date());
message.setText(text);
message.saveChanges();
Transport transport = session.getTransport("smtp");
transport.connect(host, username, password);
transport.sendMessage(message, message.getAllRecipients());
transport.close();
%>
<P>Your mail has been sent.</P>
<%
}
catch(MessagingException m)
{
out.println(m.toString());
}
%>
</BODY>
</HTML>
看看,错在那里
import=" javax.mail.*, javax.mail.internet.*, javax.activation.*,java.util.*"
%>
<html>
<head>
<TITLE>JSP meets JavaMail, what a sweet combo.</TITLE>
</HEAD>
<BODY>
<%
try{
String host = "smtp.163.net";
String from="rain_voice@163.net";
String to=request.getParameter("to");
String subject=request.getParameter("subject");
String text=request.getParameter("text");
String username = "name";
String password = "password";
Properties props = new Properties();
props.put("mail.smtp.host", host);
props.put("mail.smtp.auth", "true");
Session session = Session.getDefaultInstance(props);
session.setDebug(true);
MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress(from));
message.setRecipient(Message.RecipientType.TO, new InternetAddress(to));
message.setSubject(subject);
message.setSentDate(new Date());
message.setText(text);
message.saveChanges();
Transport transport = session.getTransport("smtp");
transport.connect(host, username, password);
transport.sendMessage(message, message.getAllRecipients());
transport.close();
%>
<P>Your mail has been sent.</P>
<%
}
catch(MessagingException m)
{
out.println(m.toString());
}
%>
</BODY>
</HTML>
看看,错在那里
#9
Java mail不如sun.net.smtp好用,你可以这样试试:
import sun.net.smtp.*;
...
host="your host name";
from="aaa@aaa.com";
to=rs.getString("bbb@bbb.com");
SmtpClient smtp=new SmtpClient(host);
smtp.from(from);
smtp.to(to);
PrintStream msg=smtp.startMessage();
msg.println("From: "+from);
msg.println("To: "+to);
msg.println();
msg.println("this is a mail test.");
msg.close();
smtp.closeServer();
...
import sun.net.smtp.*;
...
host="your host name";
from="aaa@aaa.com";
to=rs.getString("bbb@bbb.com");
SmtpClient smtp=new SmtpClient(host);
smtp.from(from);
smtp.to(to);
PrintStream msg=smtp.startMessage();
msg.println("From: "+from);
msg.println("To: "+to);
msg.println();
msg.println("this is a mail test.");
msg.close();
smtp.closeServer();
...
#10
有什么出错提示啊?
#11
有什么出错提示啊?
#12
org.apache.jasper.compiler.ParseException: /online/sendmail.jsp(2,5) Attribute ???? has no value
at org.apache.jasper.compiler.JspReader.parseAttributeValue(JspReader.java:563)
at org.apache.jasper.compiler.JspReader.parseTagAttributes(JspReader.java:681)
at org.apache.jasper.compiler.ParserController.figureOutJspDocument(ParserController.java:265)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:194)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:210)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:552)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:177)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:189)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1017)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1115)
at java.lang.Thread.run(Thread.java:536)
at org.apache.jasper.compiler.JspReader.parseAttributeValue(JspReader.java:563)
at org.apache.jasper.compiler.JspReader.parseTagAttributes(JspReader.java:681)
at org.apache.jasper.compiler.ParserController.figureOutJspDocument(ParserController.java:265)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:194)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:210)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:552)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:177)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:189)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1017)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1115)
at java.lang.Thread.run(Thread.java:536)
#13
<%@ page contentType="text/html; charset=GBK" %>
<%@ page language="java" import="java.util.*,javax.mail.*,javax.mail.internet.*"%>
<%
try{
String host = "smtp.263.net";
String from = "...";
String to = "...";
String username = "...";
String password = "....";
// Get system properties
// Properties props = System.getProperties(); 很多例子中是这样的,其实下面这句更好,可以用在applet中
Properties props = new Properties();
// Setup mail server
props.put("mail.smtp.host", host);
props.put("mail.smtp.auth", "true"); //这样才能通过验证
// Get session
Session sessionDLT = Session.getDefaultInstance(props);
// watch the mail commands go by to the mail server
sessionDLT.setDebug(true);
// Define message
MimeMessage message = new MimeMessage(sessionDLT);
message.setFrom(new InternetAddress(from));
message.addRecipient(Message.RecipientType.TO,
new InternetAddress(to));
message.setSubject("Hello JavaMail");
message.setText("Welcome to JavaMail");
// Send message
message.saveChanges();
Transport transport = sessionDLT.getTransport("smtp");
transport.connect(host, username, password);
transport.sendMessage(message, message.getAllRecipients());
transport.close();
out.println("您的邮件发送成功!");
}catch(Exception e){
out.println(e.getMessage());
}
%>
<%@ page language="java" import="java.util.*,javax.mail.*,javax.mail.internet.*"%>
<%
try{
String host = "smtp.263.net";
String from = "...";
String to = "...";
String username = "...";
String password = "....";
// Get system properties
// Properties props = System.getProperties(); 很多例子中是这样的,其实下面这句更好,可以用在applet中
Properties props = new Properties();
// Setup mail server
props.put("mail.smtp.host", host);
props.put("mail.smtp.auth", "true"); //这样才能通过验证
// Get session
Session sessionDLT = Session.getDefaultInstance(props);
// watch the mail commands go by to the mail server
sessionDLT.setDebug(true);
// Define message
MimeMessage message = new MimeMessage(sessionDLT);
message.setFrom(new InternetAddress(from));
message.addRecipient(Message.RecipientType.TO,
new InternetAddress(to));
message.setSubject("Hello JavaMail");
message.setText("Welcome to JavaMail");
// Send message
message.saveChanges();
Transport transport = sessionDLT.getTransport("smtp");
transport.connect(host, username, password);
transport.sendMessage(message, message.getAllRecipients());
transport.close();
out.println("您的邮件发送成功!");
}catch(Exception e){
out.println(e.getMessage());
}
%>
#14
可以了嘛
#15
weidegong(weidegong:
在你产这个程序中smtp sever设为smtp.263.net
可是form只能是XXX@263.net的形式时,邮件才能发送成功,这是怎么回事?
怎样才能解决这问题?
谢谢!!
在你产这个程序中smtp sever设为smtp.263.net
可是form只能是XXX@263.net的形式时,邮件才能发送成功,这是怎么回事?
怎样才能解决这问题?
谢谢!!
#16
To ajzhn(梦醉生):
这个很简单了。String host = "smtp.263.net";把这句改一下,你用哪个Email发送邮件,就用哪个的smtp服务器,比如,如果你使用新浪的邮箱来发送,那么String host = "smtp.sina.com.cn";
......weidegong慢慢地转过身去,自言自语道:不会吧,这位老兄居然连邮件发送的常识都不懂,还想发邮件?呵呵呵。。。
这个很简单了。String host = "smtp.263.net";把这句改一下,你用哪个Email发送邮件,就用哪个的smtp服务器,比如,如果你使用新浪的邮箱来发送,那么String host = "smtp.sina.com.cn";
......weidegong慢慢地转过身去,自言自语道:不会吧,这位老兄居然连邮件发送的常识都不懂,还想发邮件?呵呵呵。。。
#17
司仪:食神首先品尝的就是大龙凤酒楼的总厨,戴龙师傅的“皇帝炒饭”。
食神:好!居然能够把米放在基围虾里面来蒸熟, 再用整只*鲍鱼榨汁,加上*“官燕”来炒,表面上看起来呢是平凡无奇的炒饭, 其实是精雕细琢,高深莫测,不愧是有“炒王”的称号。
(戴师傅得意的笑)
可惜,水分太多,饭粒太软影响口感,没想到你连炒饭最基本的常识都不懂--要用隔夜饭来炒啊,炒王。零分!
戴师傅:啊?!
食神:好!居然能够把米放在基围虾里面来蒸熟, 再用整只*鲍鱼榨汁,加上*“官燕”来炒,表面上看起来呢是平凡无奇的炒饭, 其实是精雕细琢,高深莫测,不愧是有“炒王”的称号。
(戴师傅得意的笑)
可惜,水分太多,饭粒太软影响口感,没想到你连炒饭最基本的常识都不懂--要用隔夜饭来炒啊,炒王。零分!
戴师傅:啊?!
#18
呵呵,竟然跑来我的帖子灌水了,打!!!!
#19
To rain_ok(雨) ;
敢,看我不收拾你才怪^_^
敢,看我不收拾你才怪^_^
#20
哈哈,幸亏你上班不可以QQ,否则(怕怕)^_^