imap_open is very simple to use, but struggles a litte bit on setups with ssl and tls.
this are tested examples for different hosts and protocols.
uncomment the host/protocol line and fill in correct username and password.
Kay
<?php
#######
# localhost pop3 with and without ssl
# $authhost="{localhost:995/pop3/ssl/novalidate-cert}";
# $authhost="{localhost:110/pop3/notls}";
# localhost imap with and without ssl
# $authhost="{localhost:993/imap/ssl/novalidate-cert}";
# $authhost="{localhost:143/imap/notls}";
# $user="localuser";
# localhost nntp with and without ssl
# you have to specify an existing group, control.cancel should exist
# $authhost="{localhost:563/nntp/ssl/novalidate-cert}control.cancel";
# $authhost="{localhost:119/nntp/notls}control.cancel";
######
# web.de pop3 without ssl
# $authhost="{pop3.web.de:110/pop3/notls}";
# $user="[email protected]";
#########
# goggle with pop3 or imap
# $authhost="{pop.gmail.com:995/pop3/ssl/novalidate-cert}";
# $authhost="{imap.gmail.com:993/imap/ssl/novalidate-cert}";
# $user="[email protected]";
$user="username like above";
$pass="yourpass";
if ($mbox=imap_open( $authhost, $user, $pass ))
{
echo "<h1>Connected</h1>\n";
imap_close($mbox);
} else
{
echo "<h1>FAIL!</h1>\n";
}
?>