SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Member
    Join Date
    Sep 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Email Application Issue

    I am developing email application that will fetch mails from gmail, yahoo, hotmail etc. I am using imap function to fetch

    emails from gmail, yahoo etc. However while fetching I am getting only 200 mails or something as mail count, even

    though I have thousands of mails in my gmail account. May I know how to fetch all my mails using imap or pop3

    classes.

    And also how to fetch all users emails periodically. I am using crontab to fetch emails but single cron takes lot of time

    to fetch so other users will not wait until cron downloads the emails. If I make individual cron for each and every user

    then server will be very slow. Is there any alternative way to fix this issue. Thanks for all your help in advance!

  2. #2
    SitePoint Addict scoobasteve1982's Avatar
    Join Date
    Apr 2007
    Posts
    333
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not quite sure why you're only getting up to 200 emails. Sounds to me like it might be a limit set by Google, etc...but that doesn't sound correct.

    In regards to fetching periodically...you might want to consider using a JavaScript Ajax implementation to do this. Prototype provides a very nice PeriodicalExecuter JavaScript class to do this. You'd just call a JavaScript method that calls an Ajax script to grab a users mail and display accordingly...

  3. #3
    SitePoint Member
    Join Date
    Sep 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks scoobasteve1982 for your reply! Yes you may be correct steve gmail may allow to fetch only upto 200 mails per fetch. I had a chance to see it in some forum but how can i fetch next 200 mails in the second fetch. There is no proper search option for pop3 server. There is a method to search emails in imap server. If you could tell me any solution it would be great.

    Regarding periodical updater i tried javascript ajax implementation but it will work only if user is browsing the page otherwise the script will not run. I want the script to be run even if the user is offline. This must be an independent process. Can you please help in this.

  4. #4
    SitePoint Addict scoobasteve1982's Avatar
    Join Date
    Apr 2007
    Posts
    333
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not too sure about accessing the pop server as I've never done this before.

    Regarding updating even when they are offline, the simplest way to do this (as you have said before) would be a CRON script. However, you would def. want to run ONE Cron script that pulls data for all users. I'm not quite sure why you would need to grab emails if they are offline as they would not be reading them anyway - they need to be online to access them anyway. Right?

  5. #5
    SitePoint Member
    Join Date
    Sep 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes scoobasteve1982 you are correct! using imap server i can fetch all the mails from gmails only pop3 server has this issue.

    Why I want to fetch all my mails offline is for viewing the older mails or taking the backups.

  6. #6
    SitePoint Addict scoobasteve1982's Avatar
    Join Date
    Apr 2007
    Posts
    333
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you're writing a real desktop application (like in Java or something), you could just stored mail in a local database and update the database with new mail, deleted mail etc...

  7. #7
    SitePoint Member
    Join Date
    Sep 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am not creating desktop application. I am creating web application but it will more or less act like an outlook. So if i store all the emails in database will there be any performance issue? because there are lots of users and all users will have lots of emails! thanks for all your help!

  8. #8
    SitePoint Addict scoobasteve1982's Avatar
    Join Date
    Apr 2007
    Posts
    333
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No there shouldn't be too much of a performance issue. I mean mySQL is capable of handling millions of records.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •