Link to home
Start Free TrialLog in
Avatar of MarthaJ Sayers
MarthaJ Sayers

asked on

IMAP ERROR - Couldn't open stream

Hi Folks,

    I am getting preeeetty frustrated here.  I have a php page in which I need to connect to a email account and pull all the emails. I am using localhost to create this page. (Windows 64 pro - php 5.6.25 - Apache -2.4.23 - WampServer)
The mail server is hosted at HostGator.

The error msg:

Warning: imap_open(): Couldn't open stream {trvlagt.com:143/debug/imap/ssl/novalidate-cert}INBOX in C:\wamp\www\AcademyEmails\mytest.php on line 24

AND

Cannot connect to Gmail:TLS/SSL failure for trvlagt.com: Invalid token, probably not an SSL server

We are - for testing - using non-ssl setting. And I know the port is correct, the username, password etc is correct.
Below is the line of coding - I starred out the actual server/user/pwd for posting.

$inbox = imap_open('{imap.***.com:143/debug/imap/ssl/novalidate-cert}INBOX','**********','********') or die('Cannot connect:' . imap_last_error());

Open in new window


Any help apperciated - pretty urgent for me....
thank you
Avatar of kenfcamp
kenfcamp
Flag of United States of America image

It appears that you're attempting to use SSL with the imap connection

Try changing :143 to :993 and see how that works for you
Avatar of MarthaJ Sayers
MarthaJ Sayers

ASKER

Thank you for reponding. Here is what I found out. I need to use 'mail' in my imap_open(blah blah) command instead of imap !!
I can retreive everything except for the body of the message...but we will see...
Do I reward you points etc ?? You took the time to try to help...pls let me know...
Don't worry about it, that's what we're here for :)

If you resolved the question, award yourself the points, This way you save them for when you need them
ASKER CERTIFIED SOLUTION
Avatar of MarthaJ Sayers
MarthaJ Sayers

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thank you again !
Any time