javamail问题 553问题

miaosuan 2003-10-21 09:40:51
请问下列异常是怎么会事,我的程序前几天还好用,这几天却连最简单的邮件也发不了了
javax.mail.SendFailedException: Invalid Addresses;
nested exception is:
class javax.mail.SendFailedException: 553-This target address is not our MX service
553-client, nor Your envelope sender is user
at is( allowed to openly use us to relay
553-to any arbitary address throw us.
553 We don't accept this recipient.
...全文
49 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
miaosuan 2003-10-23
  • 打赏
  • 举报
回复
我觉得应该是环境的搭建的问题,或者我不小心改了它的运行环境了
miaosuan 2003-10-21
  • 打赏
  • 举报
回复
<%--senden.jsp--%>
当为
<%--sended.jsp--%>
miaosuan 2003-10-21
  • 打赏
  • 举报
回复
简单例程
<!--form.html-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>邮件例程 - JavaMail - 发送邮件</title>
</head>
<body>
<table border="0" cellspacing="0" cellpadding="0">
<form method="post" action="sended.jsp">
<tr>
<td>发信人:</td>
<td><input type="text" name="from" size="80" value="xinhao@perfectsoft.com.cn"></td>
</tr>
<tr>
<td>收信人:</td>
<td><input type="text" name="to" size="80" value="malei1000@sina.com.cn"></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="发送"></td>
</tr>
</form>
</table>
</body>
</html>


<%--senden.jsp--%>

<%@ page import="java.util.*, javax.mail.*, javax.mail.internet.*" %>
<%
String from=request.getParameter("from");
String to=request.getParameter("to");
String mailServer="mail.perfectsoft.com.cn";
//Make a session
Properties properties=System.getProperties();
Session mailsession=Session.getInstance(properties,null);
//Make a message
MimeMessage message=new MimeMessage(mailsession);
message.setFrom(new InternetAddress(from));
message.addRecipient(Message.RecipientType.TO,new InternetAddress(to));
message.setSubject(new java.lang.String("G".getBytes("ISO-8859-1")));

message.setText(new java.lang.String("C".getBytes("ISO-8859-1")));
//connect to transport
Transport transport=mailsession.getTransport("smtp");
transport.connect(mailServer,"xinhao@perfectsoft.com.cn","111111");
//Send the message
try{
transport.sendMessage(message,message.getAllRecipients());
}
catch(MessagingException e){
System.out.println("mail:"+e.toString());
}
transport.close();
%>
jspxnet 2003-10-21
  • 打赏
  • 举报
回复
code 上来别人才好帮你
linsr 2003-10-21
  • 打赏
  • 举报
回复
暂时没有遇到这种情况!
linsr 2003-10-21
  • 打赏
  • 举报
回复
不合法的地址
不可能啊!
只要有一个发送邮件的主机 例如smtp.tom.com
就可以发送到sina.com中
是不是地址输错了。

81,090

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧