Java
Chilkat2 Java
Yahoo! IMAP (imap.mail.yahoo.com)
(from Wikipedia)It is possible to get direct IMAP access without signing up for paid access nor using software like YPOPs! or FreePOPs. Yahoo! operates IMAP and secure IMAP servers (imap.mail.yahoo.com in particular), which are globally accessible. However they require a specific, non-standard IMAP command to be sent before login is done, namely: “ID ("GUID" "1")”.This example demonstrates sending the non-standard IMAP command after connecting but before login.
Chilkat Java Downloads
import com.chilkatsoft.chilkat2.ChilkatException;
import com.chilkatsoft.chilkat2.Imap;
public class ChilkatExample {
public static void main(String[] args) {
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Imap imap = new Imap();
// Connect to they Yahoo! IMAP server.
imap.setPort(993);
imap.setSsl(true);
try {
imap.connect("imap.mail.yahoo.com");
} catch (ChilkatException e) {
System.out.println(e.getLastErrorText());
return;
}
// Send the non-standard ID command...
String rawResponse = "";
try {
rawResponse = imap.sendRawCommand("ID (\"GUID\" \"1\")");
// Login
imap.login("myLogin", "myPassword");
} catch (ChilkatException e) {
System.out.println(e.getLastErrorText());
return;
}
System.out.println("Login Success!");
// Select an IMAP mailbox
try {
imap.selectMailbox("Inbox");
} catch (ChilkatException e) {
System.out.println(e.getLastErrorText());
return;
}
// Continue with whatever you wish to do...
// (see other examples..)
// Disconnect from the IMAP server.
imap.disconnect();
}
}