Best Projects
Bug Trackingsystem,Books online shopping,college management system,HR management system,Internet banking,Online chat room ,Online exam,Telephone billing system,Banking application,ATM database,airways reservation system,virtual network computing ,calculator,SMTP(simple mail transfer protocol)
Archives
-
▼
2008
(101)
-
▼
June
(32)
- EAR Utility to Compare two EAR files
- J2EE recover(Email Recoverd password)
- Servlet Application
- A CLASS SHOWS HOW
- Back&Fore ground color changer
- Magnifier (VERY NICE)JAR
- Die Roller
- DCSoft DOS Casino
- Card Base Classes
- A Civilisation Game
- Javascript Command Interpreter
- Parellel Port Viewer
- Swing Code to Maintain CD Database
- A Pong Game
- A Basic Game
- Bomber Man
- Logo using Runnable Interface
- Led Digital Clock
- Server Insertion to DB
- File to Array Convertor (JAR file)
- Java Servlet & JDBC Code for Web Development
- Animated Movable Ball
- Beat it Game
- Guessing Game
- Applet game Template.
- SMTP
- Pizza Hut
- Texteditor
- Virtual Network Computing
- GUI For RDBMS
- Calculator
- Smart Mail(Big project)
-
▼
June
(32)
J2EE recover(Email Recoverd password)
//Recover.java
//Author: Ogbole A. Israel
//this method sends the password.
public void postMail(String smtpsrv, String recipients, String subject,String message, String from) throws MessagingException {
//TODO implement postMail
boolean debug = false;
System.out.println("got here 1");
Properties props = new Properties();
System.out.println("got here 2");
props.put("mail.smtp.host", smtpsrv);
System.out.println("got here 3");
Session session = Session.getDefaultInstance(props, null);
System.out.println("got here 4");
session.setDebug(debug);
System.out.println("got here 5");
// create a message
Message msg = new MimeMessage(session);
System.out.println("got here 6");
InternetAddress addressFrom = new InternetAddress(from);
System.out.println("got here 7");
msg.setFrom(addressFrom);
System.out.println("got here 8");
InternetAddress addressTo = new InternetAddress(recipients);
System.out.println("got here 9");
msg.setRecipient(RecipientType.TO, addressTo);
System.out.println("got here 10");
msg.setSubject(subject);
System.out.println("got here 11");
msg.setContent(message, "text/html;charset=utf-8");
System.out.println("got here 12");
Transport.send(msg);
System.out.println("got here 13");
}
//this method retrives the password. asuming the email address is primary key in the user table
public String getThePassword(String id) {
//TODO implement getThePassword
UserloginLocal userllocal = null;
try{
userllocal = userloginlhome.findByPrimaryKey(id);
}catch(Exception ex){
System.out.println("Error occured in gettting th pasword " +ex.getMessage());
}
return userllocal.getPassword();
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment