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.
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....

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.