Unable te send attachment through weblogic on Solaris

Hi I am trying to send mail using Javamail api using web server as wweblogic 6 on soalris and client browser on windows but it throws exception File Not Found.

Following is the code:

/** Create the JavaMail session **/

Properties properties = System.getProperties();

properties.put("mail.smtp.host", smtpHost);

Session session = Session.getInstance(properties, null);

session.setDebug(debug);

/** Construct the message **/

MimeMessage message = new MimeMessage(session);

/** Set the from address**/

Address fromAddress = new InternetAddress(fromName);

message.setFrom(fromAddress);

/** Parse and set the recipient addresses**/

InternetAddress[] toAddresses = {new InternetAddress(toAddress)};

message.setRecipients(Message.RecipientType.TO,toAddresses);

message.setSubject(subject);

MimeBodyPart mbpMessage = new MimeBodyPart();

mbpMessage.setText(msg);

MimeBodyPart mbpAttachment = new MimeBodyPart();

/** create the Multipart and its parts to it **/

Multipart mp = new MimeMultipart();

mp.addBodyPart(mbpMessage);

FileDataSource fds;

/** attach the file to the message**/

if(!(attachment.equals("")))

{

fds = new FileDataSource(attachment);

System.out.println("File in attachment is ...."+fds.getFile());

mbpAttachment.setDataHandler(new DataHandler(fds));

mbpAttachment.setFileName(fds.getName());

mp.addBodyPart(mbpAttachment);

}

/** add the Multipart to the message**/

message.setContent(mp);

message.setSentDate(new Date());

/*Address[] ccAddresses = InternetAddress.parse(cc);

message.setRecipients(Message.RecipientType.CC,ccAddresses);*/

/* Address[] bccAddresses = InternetAddress.parse(bcc);

message.setRecipients(Message.RecipientType.BCC,bccAddresses);*/

/** Transporting the message **/

String transid = "00100 " + msgID;

msgID++;

Transport.send(message);

Same code runs well with weblogic on windows.

Please help me .

Rajeev

[2183 byte] By [rajeevmsingh] at [2007-9-26 2:11:51]
# 1
You didn't mention what line of code throws this error, so it's impossible to say anything except "Look at the line of code that throws the error, then you will know what file does not exist".
DrClap at 2007-6-29 9:04:25 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

Dear Rajeev

Please help me, how u able to send mail on windows environment.

if possible please share ur ideas with me.

I am very much need of ur guidance.

I have seen sendfile.java from javamail package, and i am unable to execute it as servlet.

I am executing from console (command prompt)

please hlep me

Thanks in advance

looking for ur reply

getfastreply@hotmail.com

rajeshkumar77 at 2007-6-29 9:04:25 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...