关于JAVAMAIL发邮件问题! 救助啦^^

java6 2001-09-09 02:36:10

请先看一下此发送JAVAMAIL的JSP程序:

<%@ page import= " javax.mail.*, javax.mail.internet.*, javax.activation.*, java.util.*"%>

<html>
<head>
<title> JavaMail 电子邮件发送系统 </title></head>
<body>
<%
try{
Properties props = new Properties();
Session sendMailSession;
Store store;
Transport transport;
sendMailSession = Session.getInstance(props, null);
props.put("mail.smtp.host", "smtp.sohu.com");
Message newMessage = new MimeMessage(sendMailSession);
newMessage.setFrom(new InternetAddress(request.getParameter("from")));
newMessage.setRecipient(Message.RecipientType.TO, new InternetAddress(request.getParameter("to")));
newMessage.setSubject(request.getParameter("subject"));
newMessage.setSentDate(new Date());
newMessage.setText(request.getParameter("text"));
transport = sendMailSession.getTransport("smtp");
transport.connect("smtp.sohu.com","wang76_cn","764688");
transport.send(newMessage);
%>
<p> 你的邮件已发送,请返回。 <p>
<%
}
catch(MessagingException m)
{
out.println(m.toString());
}
%>
</body>
</html>

我从表单中提交from: wang_cn@sohu.com
to: whsu@sina.com
怎么出错呀:

javax.mail.SendFailedException: Sending failed; nested exception is: javax.mail.MessagingException: 505 Client was not authenticated
...全文
57 点赞 收藏 2
写回复
2 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
skyyoung 2001-09-10
http://www.csdn.net/expert/TopicView.asp?id=92577
回复
olvest4000 2001-09-09
是不是有防火强
回复
相关推荐
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2001-09-09 02:36
社区公告
暂无公告