Multipart message has "text/plain" content type.
843834May 29 2008 — edited May 31 2008Hi all,
I am developing an application which can send and receive email messages including attachments.Because i dont have easy access to real mail servers at the moment, i am using my laptop to test everything("localhost"). my code so far have been able to send,receive and display text messages. it can also send email messages with attachments. The problem comes when i want to retrieve the attachment messages from the "multipart" message. message.isMimeType("multipart/*") returns false and getContentType() method on the message returns "text/plain". as a result my code can not start retreiving the attachments.
I saved the email message after Transport.Sent(mymsg). Content of the file looks like bellow.
From: user1@localhost
To: user2@localhost, user1@localhost
Message-ID: <22643639.0.1212046661890.JavaMail.user1@localhost>
Subject: test
MIME-Version: 1.0
Thu May 29 10:37:41 EAT 2008: Thu May 29 10:37:41 EAT 2008
Date: Thu, 29 May 2008 10:37:42 +0300 (EAT)
------=_Part_1_30831739.1212046661890
This is text body part.
------=_Part_1_30831739.1212046661890
Content-Disposition: attachment; filename=testfile1.txt
content of testfile1.txt
------=_Part_1_30831739.1212046661890
Content-Disposition: attachment; filename=card1.pub
content of card1.pub
------=_Part_1_30831739.1212046661890
I can also see the received messages in the inbox( JAMES mail server is in my local machine). when opened using notpad, content of these messages is same as the content of the sent messages.
I am a biginner to java mail(using 1.4.1). so any kind of help would be appreciated. can this problem be linked to using my local machine as mail server or what? I have uninstalled AVG antivirus thinking that it can be interfering. but to no vail. am really stuck at the moment.
Regards