问题
I am working in codeigniter framework using imap library. I want to get all mails from my mail server into my web app. My code is working fine when i am using
imap_open("{imap.gmail.com:993/imap/ssl}INBOX", my_email, my_password);
but whenever I tried to get access of my hostgator mail server I got these type of errors.
1: imap_open(): Couldn't open stream {mail.mydomain.com:993/imap/ssl}INBOX
2: Retrying PLAIN authentication after [AUTHENTICATIONFAILED] Authentication failed. (errflg=1).
3: Can not authenticate to IMAP server: [AUTHENTICATIONFAILED] Authentication failed. (errflg=2)
回答1:
According the HostGator Documentation you should provide (for secured imap):
- A username, your full email address
- Your password
- Your full server name
- Port: 993
- SSL: SSL/TLS
You should end up with something like
imap_open("{full.servername.com:993/imap/ssl/tls}", "my.email@servername.com","pwd");
You could also try the normal incoming mail settings which requires
- A username, your full email address
- Your password
- Your full server name
- Port: 143
- SSL: none
Resulting in:
imap_open("{full.servername.com:143}", "my.email@servername.com","pwd");
来源:https://stackoverflow.com/questions/65323660/imap-open-couldnt-open-stream-for-hostgator-server-mail-mydomain-com993-im