Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
May 24, 2012, 12:07:56 PM

Pages: [1]   Go Down
  Print  
Author Topic: PHP To Access A Mailbox  (Read 2815 times)
outofhand
Newbie
*
Offline Offline

Posts: 4


« on: March 10, 2008, 11:57:55 AM »

Anyone know how to connect to an e-mail account on a Lunarpages hosted account? I've had no luck with this code:

$mbox = imap_open("{mail.MYDOMAINNAME.com}INBOX", "EMAILADDRESS@MYDOMAINNAME.com", "test")
     or die("can't connect: " . imap_last_error());

And the response to my support ticket was to seek help here in the forums.

I want to be able to connect to a mailbox & retrieve messages and attachments, but so far I'm stuck at Step 1.

Thanks for any help!
Logged
scanman20
Senior Moderator
Über Jedi
*****
Offline Offline

Posts: 1524



WWW
« Reply #1 on: March 10, 2008, 05:26:43 PM »

Code:
$mbox = imap_open("{localhost:143}", "EMAILADDRESS@MYDOMAINNAME.com", "test");
Logged

Even a broken clock is right twice a day.
NotOneBit.com
MCSE - MCSA - MCP
outofhand
Newbie
*
Offline Offline

Posts: 4


« Reply #2 on: March 11, 2008, 08:09:36 AM »

Thanks scanman, but no luck with that either. I'm still receiving:
Warning: imap_open() [function.imap-open]: Couldn't open stream {localhost:143}....
Logged
scanman20
Senior Moderator
Über Jedi
*****
Offline Offline

Posts: 1524



WWW
« Reply #3 on: March 11, 2008, 09:28:07 AM »

Works on my LP account. Have you tried the examples at http://www.php.net/manual/en/function.imap-open.php ?
Logged

Even a broken clock is right twice a day.
NotOneBit.com
MCSE - MCSA - MCP
outofhand
Newbie
*
Offline Offline

Posts: 4


« Reply #4 on: March 11, 2008, 11:38:57 AM »

I've tried every one of the PHP.net examples with no luck. Maybe something's wrong with my e-mail account?
Logged
outofhand
Newbie
*
Offline Offline

Posts: 4


« Reply #5 on: March 11, 2008, 11:56:20 AM »

I got it. I had to add the /notls flag to the end of the host. This works:

$mbox = imap_open("{localhost:143/notls}INBOX", "EMAILADDRESS@MYDOMAINNAME.com", "test");

Now I have to get the rest of the script working!

Thanks for the help, scanman!

Logged
lexhair
Galactic Royalty
*****
Offline Offline

Posts: 406


« Reply #6 on: August 07, 2011, 06:43:50 PM »

I got it. I had to add the /notls flag to the end of the host. This works:

$mbox = imap_open("{localhost:143/notls}INBOX", "EMAILADDRESS@MYDOMAINNAME.com", "test");

Now I have to get the rest of the script working!

Thanks for the help, scanman!


Bumping this for extreme helpfulness.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to: