I HAVE DONE IT!!!!!!!
I change the default_host to:
$rcmail_config['default_host'] = 'ssl://localhost';
Originally I had the domain name without ssl. I tried it with ssl and got nothing, then tried ssl with localhost and I managed to log in.
I also changed the login to PLAIN.
Thanks for the help along the way SKaero.