email problem in SunOs using javax mail - TechRepublic
General discussion
June 12, 2000 at 07:03 PM
anjaligupta76

email problem in SunOs using javax mail

by anjaligupta76 . Updated 25 years, 8 months ago

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 =
“/home/airtel/apache/apache_1.3.9/www/htdocs/airtel/coverage.htm”;

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);
session.setDebug(debug);

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

This discussion is locked

All Comments