User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 397,814 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,579 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 2890 | Replies: 1
Reply
Join Date: Sep 2006
Posts: 17
Reputation: Dhruv Shah is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
Dhruv Shah Dhruv Shah is offline Offline
Newbie Poster

Help How to send Email from JSP Page

  #1  
Feb 19th, 2007
Hello everybody there. I am developing an application for peroject
management. Now i require that any new user has to be created
he should send an email to the adminstrator. and then adminstrator will make that person the user of the portal...

So please help me out of this problem...
<%
 String from=request.getParameter("txtfrom");
 String to="shahdhruv@cooltoad.com";
 try{
     SmtpClient client = new SmtpClient("Dhruv/10.8.86.82");
     PrintStream message = client.startMessage();
  client.from(from);
     client.to(to);
     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();
     client.closeServer();
  }
  catch (IOException e){ 
     System.out.println("ERROR SENDING EMAIL:"+e);
  }
%>
if i write this code and execute it then i am getting UnknownhostException....

Thanks...
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,183
Reputation: peter_budo has a spectacular aura about peter_budo has a spectacular aura about peter_budo has a spectacular aura about 
Rep Power: 10
Solved Threads: 265
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: How to send Email from JSP Page

  #2  
Feb 19th, 2007
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

If we helped you to solve your problem, answered your question please mark your post as SOLVED.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JSP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JSP Forum

All times are GMT -4. The time now is 6:33 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC