I am trying to integrate an email client into a web app so the admins for a site don't have to login to two different places (too confusing for them). I am unable to get my code to connect to the mail servers even though my code is able to access Gmail, Yahoo, AOL, ect. I use Thunderbird for my personal email client, so the information it has on the server configuration as well as the information that is provided for using an email client I think would be enough to configure my imap code, but I am getting errors no matter how I configure it.
Here's my code, in the comments I have listed many of the variations I have tried for the "$hostname" (domain name email address and password were change for posting here).
I am fairly certain I need either the "novalidate-cert" or "notls" flags because without one of them I get this error
So with either the "novalidate-cert" or "notls" flag and using the "imap" flag I get this error no matter what other flags I use
And with the pop3 flag (and "novalidate-cert" or "notls") no matter what other flag I use I get this error
And of course with each of those I get an error similar to this, and of course all other imap functions fail as well
I tried "email@mydomain.com", "email+mydomain.com" (per the email client configuration page) and "email" for the username, also double checked the password (logged in via webmail). So I must assume I don't have the "$hostname" configured correctly. So if anyone knows what I should set the "$hostname" to it would be greatly appreciated.
Here's my code, in the comments I have listed many of the variations I have tried for the "$hostname" (domain name email address and password were change for posting here).
PHP Code:
// $hostname = '{mail.mydomain.com:143/imap}INBOX';
// $hostname = '{mail.mydomain.com:143/pop3}INBOX';
// $hostname = '{mail.mydomain.com:143/imap/notls}INBOX';
// $hostname = '{mail.mydomain.com:143/pop3/notls}INBOX';
// $hostname = '{mail.mydomain.com:143/imap/novalidate-cert}INBOX';
// $hostname = '{mail.mydomain.com:143/pop3/novalidate-cert}INBOX';
// $hostname = '{mail.mydomain.com:143/imap/notls/novalidate-cert}INBOX';
// $hostname = '{mail.mydomain.com:143/pop3/notls/novalidate-cert}INBOX';
// $hostname = '{mail.mydomain.com:143/imap/notls/norsh/novalidate-cert}INBOX';
// $hostname = '{mail.mydomain.com:143/pop3/notls/norsh/novalidate-cert}INBOX';
// $hostname = '{mail.mydomain.com:143/imap}';
// $hostname = '{mail.mydomain.com:143/pop3}';
// $hostname = '{mail.mydomain.com:143/imap/notls}';
// $hostname = '{mail.mydomain.com:143/pop3/notls}';
// $hostname = '{mail.mydomain.com:143/imap/novalidate-cert}';
// $hostname = '{mail.mydomain.com:143/pop3/novalidate-cert}';
// $hostname = '{mail.mydomain.com:143/imap/notls/novalidate-cert}';
// $hostname = '{mail.mydomain.com:143/pop3/notls/novalidate-cert}';
// $hostname = '{mail.mydomain.com:143/imap/notls/norsh/novalidate-cert}';
// $hostname = '{mail.mydomain.com:143/pop3/notls/norsh/novalidate-cert}';
$hostname = '{mail.mydomain.com:143}';
$username = 'email@mydomain.com';
$password = 'password';
$mbox = imap_open($hostname, $username, $password);
Certificate failure for mail.mydomain.com: Server name does not match certificate: SERIALNUMBER=0y5LL1cbrMRv1OcrTFzg/4/JzbmjaY9T, C=US, O=*.gzo.com, OU=GT97607460, OU=See www.rapidssl.com/resources/cps (c)11, OU=Domain Control Validated - RapidSSL(R), CN=*.gzo.com
Notice: Unknown: [AUTHENTICATIONFAILED] Authentication failed. (errflg=1) in Unknown on line 0
Notice: Unknown: [AUTHENTICATIONFAILED] Authentication failed. (errflg=1) in Unknown on line 0
Notice: Unknown: [AUTHENTICATIONFAILED] Authentication failed. (errflg=1) in Unknown on line 0
Notice: Unknown: Too many login failures (errflg=2) in Unknown on line 0
Notice: Unknown: [AUTHENTICATIONFAILED] Authentication failed. (errflg=1) in Unknown on line 0
Notice: Unknown: [AUTHENTICATIONFAILED] Authentication failed. (errflg=1) in Unknown on line 0
Notice: Unknown: Too many login failures (errflg=2) in Unknown on line 0
Notice: Unknown: OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE STARTTLS AUTH=PLAIN AUTH=LOGIN] Dovecot ready. (errflg=2) in Unknown on line 0
Warning: imap_open() [function.imap-open]: Couldn't open stream {mail.domain.com:143/imap/novalidate-cert}INBOX in ...
Comment