ERLEDIGT
JA
JA
ANTWORTEN
3
3
ZUGRIFFE
1082
1082
EMPFEHLEN
-
Hallo,
ich hab es bisher geschafft über Java Mails zu versenden; jetzt möchte ich sie auch empfangen. Ich hab dazu einen Code von der JavaInsel übernommen und meine Zugangsdaten für meinen aol Account eingetragen:
Code :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
import java.util.*; import java.io.*; import javax.mail.*; import javax.mail.internet.*; public class Main { public static void getMail( String host, String user, String passwd ) throws Exception { Session session = Session.getDefaultInstance( new Properties() ); Store store = session.getStore( "pop3" ); store.connect( host, user, passwd ); Folder folder = store.getFolder( "INBOX" ); folder.open( Folder.READ_ONLY ); Message message[] = folder.getMessages(); for ( int i = 0; i < message.length; i++ ) { Message m = message[i]; System.out.println( "Nachricht: " + i ); System.out.println( "From: " + m.getFrom()[0] ); System.out.println( "Subject: " + m.getSubject() ); Multipart mp = (Multipart) m.getContent(); for ( int j = 0; j < mp.getCount(); j++ ) { Part part = mp.getBodyPart( j ); String disposition = part.getDisposition(); if ( disposition == null ) { MimeBodyPart mimePart = (MimeBodyPart)part; if ( mimePart.isMimeType("text/plain") ) { BufferedReader in = new BufferedReader( new InputStreamReader(mimePart.getInputStream()) ); for ( String line; (line=in.readLine()) != null; ) System.out.println( line ); } } } } folder.close( false ); store.close(); } public static void main( String args[] ) throws Exception { getMail( "pop.aol.com", "user@aol.de", "pass" ); } }
Dabei bekomm ich immer die Meldung
DEBUG POP3: server doesn't support TOP, disabling it
Ich hab leider keine Ahnung, was ich ändern muss
Wär echt klasse, wenn ihr mir helfen könntet
-
TOP:
This is an optional POP3 command. Not all POP3 servers support it. It lists the header for msg# and the first #lines of the message text. For example, TOP 1 0 would list just the headers for message 1, where as TOP 1 5 would list the headers and first 5 lines of the message text.
Schade, dass ihr mir nicht helfen könnt.
Ich wüsste nur gerne, wie ich in java TOP deaktivieren kannn...
-
(Quelle)You can set the property "mail.pop3.disabletop" to "true" to disable the use of the TOP command, but note that this will cause any access to the message headers to fetch the entire message
Das wäre zumindest das, was google als erstes aausspuckt.
Hilft das?
Gruß,
RoCMe
-
Ich glaube, ich sollte das jetzt hinbekommen.
Mal sehen...
Vielen Dank
Ähnliche Themen
-
E-Mails abrufen - Fehlerhafte Darstellung
Von iXtends im Forum PHPAntworten: 6Letzter Beitrag: 05.06.08, 15:07 -
fetchmail - Mails abrufen und zuteilen - wie?
Von magic_halli im Forum Linux & UnixAntworten: 2Letzter Beitrag: 30.10.06, 16:02 -
E-Mails Abrufen mit PHP
Von DelphiDell im Forum PHPAntworten: 2Letzter Beitrag: 15.01.06, 21:05 -
Abrufen und verarbeiten von Mails (MIME), ev. Klasse gesucht
Von BKBB im Forum PHPAntworten: 10Letzter Beitrag: 03.11.05, 19:32 -
E-Mails abrufen
Von flasherMX im Forum .NET ArchivAntworten: 3Letzter Beitrag: 26.02.04, 16:10





Zitieren
Login





