寻
寻找
Unregistered / Unconfirmed
GUEST, unregistred user!
ERROR SENDING EMAIL:sun.net.smtp.SmtpProtocolException: 501 input error.
程序:
<%@ page import="sun.net.smtp.SmtpClient, java.io.*"
%>
<%
String from="glint530@163.com";
String to="glintstar@21cn.com";
try{
SmtpClient client = new SmtpClient("10.0.0.200"
client.from(from);
client.to(to);
PrintStream message = client.startMessage();
message.println("To: "
+ to);
message.println("Subject: Sending email from JSP!"
message.println("This was sent from a JSP page!"
message.println();
message.println("Cool beans! "
message.println();
message.println("Govind Seshadri"
message.println("jGuru.com"
message.println();
client.closeServer();
}
catch (IOException e){
out.println("ERROR SENDING EMAIL:"+e);
}
%>
10.0.0.200是局域网内的邮件服务器
程序:
<%@ page import="sun.net.smtp.SmtpClient, java.io.*"
%>
<%
String from="glint530@163.com";
String to="glintstar@21cn.com";
try{
SmtpClient client = new SmtpClient("10.0.0.200"
client.from(from);
client.to(to);
PrintStream message = client.startMessage();
message.println("To: "
+ to);
message.println("Subject: Sending email from JSP!"
message.println("This was sent from a JSP page!"
message.println();
message.println("Cool beans! "
message.println();
message.println("Govind Seshadri"
message.println("jGuru.com"
message.println();
client.closeServer();
}
catch (IOException e){
out.println("ERROR SENDING EMAIL:"+e);
}
%>
10.0.0.200是局域网内的邮件服务器