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
Email ServersPHP

Avatar of undefined
Last Comment
kenfcamp

8/22/2022 - Mon
kenfcamp

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

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
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
ASKER CERTIFIED SOLUTION
MarthaJ Sayers

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
MarthaJ Sayers

ASKER
thank you again !
kenfcamp

Any time