Popping Email using PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
oldtimer
Forum Contributor
Posts: 204
Joined: Sun Nov 03, 2002 8:21 pm
Location: Washington State

Popping Email using PHP

Post by oldtimer »

besides imap_open does anyone know any functions for popping email. some servers wont allow the imap_open to go through with either pop or imap connection. Been searching and not having any luck.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

oldtimer wrote:some servers wont allow the imap_open to go through with either pop or imap connection.
you mean the actual network connection is blocked?
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

oldtimer
Forum Contributor
Posts: 204
Joined: Sun Nov 03, 2002 8:21 pm
Location: Washington State

Post by oldtimer »

This is what I get


<b>Warning</b>: imap_open(): Couldn't open stream {mail.thedomain.com/pop3:110}INBOX in <b>/home/crontasks/bounce_check.php</b> on line <b>13</b><br />
Could not open Mailbox - try again later!


now the same routine for imap give same error but it works for lets say my personal server.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

let's see some code...
you should have something like this:

Code: Select all

$mail = imap_open("{mail.thedomain.com:110/pop3}INBOX", "username", "password");
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

when I looked at this thread's title I thought it said "pooping out email" and since I'm immature and dorky I cracked up laughing. :lol:
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

try telnetting too to see if you can get in that way:

Code: Select all

telnet mail.thedomain.com 110
USER username
PASS password
LIST
if that works, then you could do as first suggested and use fsockopen() in conjunction with fwrite()
oldtimer
Forum Contributor
Posts: 204
Joined: Sun Nov 03, 2002 8:21 pm
Location: Washington State

Post by oldtimer »

It does let me login. I can use a perl module and it works. just not the imap open.
I will check out the fsockopen and see if i can get that to work. I dont write to files i put all data into a DB. Execpt with the imap open i do save the attachments to the server.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

One things bugs me about the IMAP functions. You can't surpress those errors. No matter what yu try they'll always get printed to the bottom of the page. Not sure if this has been fixed now or not.

Have you looked at PEAR mail?
oldtimer
Forum Contributor
Posts: 204
Joined: Sun Nov 03, 2002 8:21 pm
Location: Washington State

Post by oldtimer »

I have used pear mail for sending. I also learning class.phpmailer.php / class.smtp.php and these are great for sending. but did not know pear mail could be used to check email.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

oldtimer wrote:I have used pear mail for sending. I also learning class.phpmailer.php / class.smtp.php and these are great for sending. but did not know pear mail could be used to check email.
There's one. It might be called PEAR IMAP but there's definitely one cos I've had the dis-pleasure of using it :P
Post Reply