Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem in socket connection  RSS feed

Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i wrote a jsp program.Where i made a connection to i write the code as
<%@ page import=",*" %>
<%@ page import="java.util.*"%>
<%@ page import="javax.mail.internet.*"%>
<%@ page import="javax.mail.*"%>
<%@ page import="javax.activation.*"%>
<%@ page import="javax.mail.Transport"%>
<%@ page import=""%>
<%@ page import="*"%>
<%@ page import="javax.mail.Message.*"%>
<%@ page import=""%>
<%@ page import="com.jscape.inet.smtp.Smtp"%>

String from="";
String to="";
SmtpClient smtpclient = new SmtpClient("Thinkways25")//(this is the name of my localhost.the ipaddress is i gave both the name and ip address of my computer)
PrintStream message = smtpclient.startMessage();
message.println("To: " + to);
message.println("Subject: Sending email from JSP!");
message.println("This was sent from a JSP page!");
message.println("Cool beans! :-)");

System.out.println("hi done");
catch (Exception e){
System.out.println("ERROR SENDING EMAIL:"+e);

but i m getting the error mailhost
plz help me in this regard.
if possible plz show me the right code
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!