hi friends,
I am trying to develop a FormMailer application using
Servlets or
JSP. I tried the thing by using the code mentioned below, but i am getting an error " sun.net.smtp:Sun.ProtocolException 550 5.7.7. Unable to relay to
amits_007@rediffmail.com" on the DOS prompt and my browser screen doesnt show anything.I am using
TOMCAT as the server and JSP as the front end.
CODE follows:
<%@ page language="java" import="sun.net.smtp.SmtpClient, java.io.*" %>
<%
String from="amits_007@hotmail.com";
String to="amits_007@rediffmail.com";
try{ SmtpClient client = new SmtpClient("mail.yahoo.com");
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();
out.println("amirr");
}
catch (IOException e){ System.out.println("ERROR SENDING EMAIL:"+e); }%>
Kindly help me out with this. Please suggest if there is any other way by which this applicatin can be made.
Bye,
Amit