December 19, 2009
December 18, 2009
December 17, 2009
December 16, 2009
December 15, 2009
Google Phone
So I read about it yesterday and I was not going to post on it...but this bothers me. Android phone choices are getting more complex...which actually hurts the developers in some ways.
December 14, 2009
Java and POP3 with Hotmail
A simple example as we learn more on the mail protocols:
package email;
import javax.mail.*;
public class MailUtils {
public static Store getStore(Account account) throws MessagingException {
return getStore(account.Email, account.Password);
}
public static Store getStore(String email, String password) throws MessagingException {
java.util.Properties props = new java.util.Properties();
props.setProperty("mail.pop3.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
props.setProperty("mail.pop3.socketFactory.fallback", "false");
props.setProperty("mail.pop3.socketFactory.port", "995");
javax.mail.Session session = Session.getDefaultInstance(props);
Store store = session.getStore("pop3");
store.connect("pop3.live.com", email, password);
return store;
}
public static Folder[] getFolders(Store store) throws MessagingException
{
return store.getDefaultFolder().list("*");
}
public static Folder getFolderByUrl(Store store, String url) throws MessagingException
{
return store.getFolder(new URLName(url));
}
public static Message[] getMessages(Folder folder) throws MessagingException {
try {
folder.open(Folder.READ_ONLY);
Message[] messages = folder.getMessages();
for(Message m : messages) {
String s = m.getSubject();
System.out.print(s);
}
return messages;
}
finally {
//folder.close(false);
}
}
}
December 13, 2009
Good Weekend
Hope everyone had a good weekend! A lot of work on POP3 and IMAP this weekend...will share the details tomorrow.
Subscribe to:
Posts (Atom)