General discussion

Locked

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 =
"/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 conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Back to Web Development Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums