Downloading sent mails from Yahoo, Gmail and Hotmail

后端 未结 2 1623
悲哀的现实
悲哀的现实 2021-02-16 00:45

I am doing an Android application and I want to get the last 25 sent mails from a certain email account.

For Gmail I might use http://g4j.sourceforge.net/ and there is M

相关标签:
2条回答
  • 2021-02-16 01:04

    You can download (or maybe upload) emails in various ways when using different email providers. My experience with the following providers is:

    1. Yahoo:

      • POP3: Only available for Plus users (paid service). No get new messages, no folder access, no sent mail; just fetch all inbox (or all email UIDs). UPDATE: Yahoo provides free POP access and forwarding for Yahoo Asia users.
      • Mail Web Service API: Only listing email headers for Free users but complete access, including fetch mail from sent folder, for Plus users (paid service again). Of course, you are paid a commission by Yahoo if you can encourage (force) users to buy the Plus service if you are not sued before that by Yahoo lawyers because it is stated in the Web Service documentation that: "You may not use the Yahoo! Mail Web Service API to display the user's Yahoo! account information in a third party email client".
      • Web Scraping: It seems the only available solution for Free users of Yahoo but be aware of the compatibility problems that may arise when Yahoo changes its web pages. Also make sure to delay link accesses because Yahoo has web scraping detection mechanism on its servers.
    2. GMail:

      • IMAPv4: Available for all users. Make sure to use this protocol for accessing almost everything in GMail. It is implemented completely; you can access all incoming and sent mails and even send an email by saving it in the sent folder. You can use JavaMail or any other IMAP client library in Java such as Ristretto API to do this. Make sure to know the JavaMail limitations before starting to use it for any protocol. It has many limitations (and minor bugs) in all protocols (SMTP/POP3/IMAP).
      • POP3: Available for all users of GMail but not recommended because of POP3 inherent limitations (no folder, no get new messages).
    3. Hotmail:

      • POP3: Available for all users but again POP3 inherent limitations (no folder, no sent mail, no get new messages) in addition to Hotmail limitation called 15-minutes-delay-necessary for POP3 access.
      • Web Scraping: It seems the only solution for accessing sent mail but again be aware of the compatibility problems that may arise when Microsoft changes Hotmail web pages and web scraping detection software which may exist.
    4. General IMAPv4 Provider:

      • In general, not all IMAP providers support sent folder because it is not a standard IMAP folder but most of them do this. Take a look at the provider's Help or FAQ for this option.
    5. Genral POP3 Provider:

      • Do not expect POP3 to do this because POP3 does its best not to crash both the client and server when fetching 2 new emails from inbox ;-)

    Meanwhile, do not forget that Web Scraping has legal issues and is forbidden in most web sites.

    0 讨论(0)
  • 2021-02-16 01:09

    In our company's webapp, we use JavaMail to send mail through gmail account (very easy to use and powerful API). On JavaMail third-party product page I found project JDAVMail. It provides access method for WebDAV based protocol services. Maybe it'll be useful for you.

    And, for Android: javamail-android

    0 讨论(0)
提交回复
热议问题