HI,
Below the Java sendmail source code , and i am not aware of any JVM new or old.
Below is the complete source code.
Regards
John
import java.io.*;
import java.sql.*;
import java.util.*;
import javax.mail.*;
import javax.mail.event.*;
import javax.mail.internet.*;
import javax.activation.*;
public class sendmail
{
static Connection cn;
static Statement stat;
static Statement stat1;
static Statement stat2;
static Statement stat3;
static String proxyname = "" ;
static String servername= "";
static String mailid="";
private static String mailHost = "";
public String sendMail(String strTo, String strSubject, String strMailText, String strFrom, String strattachfile, String strTitle, String strCity,String strContract,String strMailTime) throws Exception //MessagingException
{
Properties properties = System.getProperties();
Session session = Session.getInstance(properties,null);
ConnectionHandler conHandler = new ConnectionHandler();
TransportHandler transHandler = new TransportHandler();
Message message = new MimeMessage(session);
InternetAddress address_to = new InternetAddress(strTo);
String formatter;
String SimpleDateFormat;
message.setRecipient(Message.RecipientType.TO,address_to);
//if (strContract=="AKAI"

{
message.setFrom(new InternetAddress(strFrom,"JustDial Feedback Alert"

);
//message.setFrom(new InternetAddress(strFrom,"AKAI - Call Centre"

);
//}
//else {
//message.setFrom(new InternetAddress(strFrom,"JustDial Feedback Alert"

);
//}
//message.setFrom(new InternetAddress(strFrom,"1947 Feedback Alert"

);
//Address address = new InternetAddress("president@whitehouse.gov", "George Bush"

;
//Date formatter starts here
// The hour (1-12)
// formatter = new SimpleDateFormat("h"

; // 8
// formatter = new SimpleDateFormat("hh"

; // 08
// The hour (0-23)
// formatter = new SimpleDateFormat("H"

; // 8
// formatter = new SimpleDateFormat("HH"

; // 08
// The minutes
// formatter = new SimpleDateFormat("m"

; // 7
// formatter = new SimpleDateFormat("mm"

; // 07
// The seconds
// formatter = new SimpleDateFormat("s"

; // 3
// formatter = new SimpleDateFormat("ss"

; // 03
// The am/pm marker
// formatter = new SimpleDateFormat("a"

; // AM
// The time zone
// formatter = new SimpleDateFormat("z"

; // PST
// formatter = new SimpleDateFormat("zzzz"

; // Pacific Standard Time
// formatter = new SimpleDateFormat("Z"

; // -0800
// Get today's date
// Date date = new Date();
// Some examples
// formatter = new SimpleDateFormat("hh:mm:ss a"

;
// String s = formatter.format(date);
// 01:12:53 AM
// formatter = new SimpleDateFormat("HH.mm"

;
// s = formatter.format(date);
// 14.36.33
// End of date format
java.util.Date d=new java.util.Date();
String tm=d.getHours()+":"+d.getMinutes();
//if (strContract == "AKAI"

{
// message.setSubject(" CC C # " + strTitle);
// strMailText=" AKAI Complaint ";
//}
//else {
message.setSubject( strCity+ " # " + strTitle + strSubject + " " + strMailTime);
//}
//message.setSubject("Mumbai : Enquires for the Day"

;
MimeBodyPart mbp1 = new MimeBodyPart();
mbp1.setText(strMailText);
// create the second message part
MimeBodyPart mbp2 = new MimeBodyPart();
MimeBodyPart mbp3 = new MimeBodyPart();
// attach the file to the message
FileDataSource fds=new FileDataSource("c:\\program files\\unijust\\data_out\\" + strattachfile);
mbp2.setDataHandler(new DataHandler(fds));
mbp2.setFileName("JDS.txt"

;
FileDataSource fds1=new FileDataSource("c:\\program files\\unijust\\data_out\\test1.htm"

;
mbp3.setDataHandler(new DataHandler(fds1));
mbp3.setFileName("JDS.htm"

;
// create the Multipart
//and its parts to it
Multipart mp = new MimeMultipart();
mp.addBodyPart(mbp1);
mp.addBodyPart(mbp2);
mp.addBodyPart(mbp3);
// add the Multipart to the message
message.setContent(mp);
message.saveChanges();
Transport transport = session.getTransport("smtp"

;
transport.addConnectionListener(conHandler);
transport.addTransportListener(transHandler);
transport.connect(mailHost,"",""

;
transport.sendMessage(message,message.getAllRecipients());
String transportStatus = "notSet";
boolean transportFlag = false;
while(!transportFlag)
{
if(transportStatus.equals("successful"

)
transportFlag = true;
else if(transportStatus.equals("part"

)
transportFlag = true;
else if(transportStatus.equals("not"

)
transportFlag = true;
transportStatus = transHandler.getStatus();
}
transport.close();
return transportStatus;
}
class TransportHandler extends TransportAdapter
{
String finalStatus= "notSet";
public void messageDelivered(TransportEvent e)
{
setStatus("successful"

;
System.out.println(">>>> Message delivered successfully"

;
}
public void messageNotDelivered(TransportEvent e)
{
setStatus("not"

;
System.out.println(">>>> Message NOT delivered"

;
}
public void messagePartiallyDelivered(TransportEvent e)
{
setStatus("part"

;
System.out.println(">>>> Message Partially delivered"

;
}
public void setStatus(String indata){
finalStatus = indata;
}
public String getStatus(){
return finalStatus;
}
}
class ConnectionHandler extends ConnectionAdapter
{
public void opened(ConnectionEvent e)
{
System.out.println(">>>> Connection opened"

;
}
public void disconnect(ConnectionEvent e)
{
System.out.println(">>>> Connection disconnected"

;
}
public void closed(ConnectionEvent e)
{
System.out.println(">>>> Connection closed"

;
}
}
public static void main(String args[])
{
sendmail s=new sendmail();
ResultSet out_mail=null;
while(true)
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"

;
cn=DriverManager.getConnection("jdbc

dbc:javadsn"

;
stat1=cn.createStatement();
stat2=cn.createStatement();
stat3=cn.createStatement();
}
catch(Exception e){ System.out.println("DSN Error " + e);}
System.out.println("DSN Connected"

;
try{
out_mail=stat1.executeQuery("select * from out_mail where outgoingstatus like 'NO%'"

;
}
catch(Exception e){ System.out.println("File Not Found " + e);}
System.out.println("outfile read Connected"

;
try{
ResultSet smtp=stat2.executeQuery("select * from smtpserver"

;
smtp.next();
proxyname=smtp.getString("proxyname"

;
servername=smtp.getString("servername"

;
mailHost = servername ;
mailid=smtp.getString("from"

;
smtp.close();
}
catch(Exception e){ System.out.println("File Not Found " + e);}
System.out.println("SMTP read"

;
String mailSubject = ", enquiry for you at ";
String mailText = "Dear Sir/Madam, \n \n Please Find JustDial Services - Feedback Report attached as text file.\n\n Regards \n Customer Service Department \n JustDial Services";
//String mailText = "Dear Sir/Madam, \n \n Please Find 1947 - Feedback Report attached as text file.\n\n Regards \n Customer Service Department \n 1 9 4 7";
try{
stat3.executeUpdate("update parameter set parameter_value=1 where parameter_type like 'EMAILSTATUS'"

;
stat3.close();
}
catch(Exception e){ System.out.println("File Not Found " + e);}
try
{
System.out.println("Before outmail"

;
while(out_mail.next())
{
System.out.println("test"

;
java.util.Date d=new java.util.Date();
String dt=d.getMonth()+1+"/"+d.getDate()+"/"+(d.getYear()+1900);
String tm=d.getHours()+":"+d.getMinutes()+":"+d.getSeconds();
Connection cnn=null;
cnn=DriverManager.getConnection("jdbc

dbc:javadsn"

;
try
{
String toutmsgid = out_mail.getString("outmsgid"

;
s.sendMail(out_mail.getString("outemailnumber"

,mailSubject,mailText,mailid,out_mail.getString("outemailfile"

,out_mail.getString("inmsg"

,out_mail.getString("mcity"

,out_mail.getString("contract"

,out_mail.getString("outemailtime"

);
stat=cnn.createStatement();
stat.executeUpdate("update out_mail set outgoingstatus='YES',outemaildate='"+ dt +"', outemailtime ='"+ tm +"' where outmsgid like '"+toutmsgid+"'"

;
System.out.println("update out_mail set outgoingstatus='YES' where outmsgid like '"+toutmsgid+"'"

;
stat.close();
}
catch(Exception e)
{
System.out.println("Error from main : " + e);
try{
Statement st = cnn.createStatement();
//st.executeUpdate("insert into error_msg values('"+ dt +"', '"+ tm +"','Java Mail"+ e +"')"

;
st.close();
}catch(Exception ee){System.out.println("Other Error :"+ee);}
}
////////////// updating parameter /////
try
{
stat3=cn.createStatement();
//stat3.executeUpdate("update parameter set parameter_value=0 where parameter_type like 'EMAILSTATUS'"

;
stat3.close();
}catch(Exception e){ System.out.println("paramter value update error " + e);}
cnn.close();
}// end of while loop
out_mail.close();
}
catch(Exception e){System.out.println("Error :"+e);}
} // closing contineous loop
} // end of main function
}// end of CLass
*** Even the Best, did the Bad and Made the Best ***
John Philip