hi everyone ,

java mail program successfully run on local tomcat server.
But this java mail program not run on internet tomcat server.
i dont know what is reason.
but i did not get any exception from server.
please help.

This is my code
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

//Host name, to address, from address
String to = "career@company.com";
String host = "companyhost";
String from = "company@company.com";

//Attachments file,subject, body information
//Getting from html file with help ajax

String name=request.getParameter("name");
String qualification =request.getParameter("qualification");
String percentage=request.getParameter("percentage");
String fromEmail =request.getParameter("fromEmail");
String phoneno=request.getParameter("phoneno");
String keySkills=request.getParameter("keySkills");
String yearExp=request.getParameter("yearExp");
String filename=request.getParameter("filename");
boolean flag=false;

//System.out.println(filename);
//String filename="c:/Help.doc";

//boolean debug = Boolean.valueOf(filename).booleanValue();
String msgText1 = "Name :"+ name + "\nPercentage :" + percentage + "\nFrom Email :" + fromEmail + "\nPhone Number :" + phoneno + "\nKey Skills :" + keySkills + "\nExperience :" + yearExp +" years";
String subject = name+" / "+qualification;

// create some properties and get the default Session
//Properties props = System.getProperties();
//props.put("mail.smtp.host", host);
//props.put("mail.smtp.port", port);
//props.put("mail.debug", "true");


//Create some properties and get the default session
Authenticator authenticator = new Authenticator();
Properties properties = new Properties();
properties.setProperty("mail.smtp.submitter", authenticator.getPasswordAuthentication().getUserN ame());
properties.setProperty("mail.smtp.auth", "true");

properties.setProperty("mail.smtp.host", host);
properties.setProperty("mail.smtp.port", "25");
Session session = Session.getDefaultInstance(properties, authenticator);
//session.setDebug(debug);

try {
// create a message
MimeMessage msg = new MimeMessage(session);
msg.setFrom(new InternetAddress(from));
InternetAddress[] address = {new InternetAddress(to)};
msg.setRecipients(Message.RecipientType.TO, address);
msg.setSubject(subject);

// create and fill the first message part
MimeBodyPart mbp1 = new MimeBodyPart();
mbp1.setText(msgText1);

// create the second message part
MimeBodyPart mbp2 = new MimeBodyPart();

// attach the file to the message
FileDataSource fds = new FileDataSource(filename);
mbp2.setDataHandler(new DataHandler(fds));
mbp2.setFileName(fds.getName());

// create the Multipart and add its parts to it
Multipart mp = new MimeMultipart();
mp.addBodyPart(mbp1);
mp.addBodyPart(mbp2);

// add the Multipart to the message
msg.setContent(mp);

// set the Date: header
msg.setSentDate(new java.util.Date());

// send the message
Transport.send(msg);
flag=true;


}catch (MessagingException mex) {
// Prints all nested (chained) exceptions as well
mex.printStackTrace();
}
//whether mail has been sent or not.
if(flag)
{
response.setContentType("text/xml");
response.setHeader("Cache-Control", "no-cache");
response.getWriter().write("success");
}
else
{
response.setContentType("text/xml");
response.setHeader("Cache-Control", "no-cache");
response.getWriter().write("failure");
}
}

// Java mail authentication coding.
private class Authenticator extends javax.mail.Authenticator {
private PasswordAuthentication authentication;

public Authenticator() {
String username = "career@company.com";
String password = "****";
authentication = new PasswordAuthentication(username, password);
}

protected PasswordAuthentication getPasswordAuthentication() {
return authentication;
}
}