Web Development

General discussion


email problem in SunOs using javax mail

By anjaligupta76 ·
I am facing one problem in sending mail.When I execute the class in a
windows system using a win-nt SMTP server it sends the mail. But the same
code doesnot run on SunOs system .
the code is as follows:

public void send(String fromId,String toId,String subjectLine,String
textMsg,String thefile)
String to = toId;
String from = fromId;
String host = "del1@gtaonline.com;//here we givw the SMTP server ip
String filename =

file://boolean debug = Boolean.valueOf(args[4]).booleanValue();
boolean debug = true;
String msgText1 = textMsg;
String subject = subjectLine;

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

Session session = Session.getDefaultInstance(props, null);

// create a message
MimeMessage msg = new MimeMessage(session);
msg.setFrom(new InternetA

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Related Discussions

Related Forums