Jump to content

Access POP3 with PHP without IMAP Extensions


muzicman82

Recommended Posts

I'm trying to write a PHP script for a cron job that will do the following:

- Connect to a POP3 server.
- Check the logged in user's current used space.
- If the used space is a certain size, send an e-mail notifying.
- If the used space is a certain size, delete all messages.

Basically, we're on shared hosting that doesn't have IMAP support with PHP. The purpose of this script is to manage some mailboxes that aren't typical users. We've just switch to this host and they don't provide the ability to set a mailbox quota. So, to prevent a mailbox from filling up with SPAM, etc, this cron script will dump it when it reaches a certain size and notify an admin when it does something.

I have looked at PEAR's Net_POP3, but couldn't get much of that to work. I may spend some more time with it, but wasn't having much luck. I do have SSH access and have created a local copy of the PEAR folders. I tried an example script but it kept giving me a general connection error... but I wasn't getting any other error.

I'm on the lookout for an alternate class or something that will work.
Link to comment
Share on other sites

I found an example of interacting with POP3 using sockets

[url=http://www.thescripts.com/forum/thread1790.html]http://www.thescripts.com/forum/thread1790.html[/url]

If you know what commands to send to the server to do the things you want it should be a matter of using something like

[code]
fputs($socket, "$command\r\n"); // send command
[/code]

Good luck with that....
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.