tags:

views:

21

answers:

2

Would it be best to read from gmail via pop3/imap? Or should/must I use an http script that actually logins in via web interface and gets all the emails that way?

Also, I would like to iterate this question for:

  • live
  • hotmail
  • [any other major web mail provider]
+2  A: 

To read incoming messages, you should use POP or IMAP.
To send messages, you should use SMTP.

Your choice of protocol depends on what you're trying to do and what the mail provider supports. (Gmail supports all three)

Use POP if you want to process all incoming messages without affecting them elsewhere.
Use IMAP if you want to manipulate the messages on the site (eg, to move them into folders).
Use SMTP to send email.

Manually scraping a webmail site (especially a modern AJAXy webmail site) is a recipe for disaster.

SLaks
A: 

POP or IMAP will be standard for a long time; you would certainly have to make ongoing compatibility changes to an http script. Besides being barbaric.

Also, remember SMTP is for sending mail, not reading it.

Nathan