use java Mail for Sending Mail.
use Following Packages,
javax.mail,javax.mail.internet,
java.net.InetAddress
use mail.jar, activation.jar in classpath...
Create Properties like
properties.put("mail.smtp.host", strHostName);
properties.put("mail.debug", "false");
then get Session
session = Session.getDefaultInstance(properties, null);
Create Message
Message msgBody = new MimeMessage(session);
set the From Address to Message
msgBody.setFrom(new InternetAddress(strFrom));
set to Address
InternetAddress[] address = (new
InternetAddress()).parse(strToAddr);
msgBody.setRecipients(Message.RecipientType.TO, address);
set the Subject...
msgBody.setSubject("Hi How r u ");
Send the Message
Transport.send(msgBody);