Failure when trying to connect to SMTP mail server

Hello everyone !

I have a kind of huge situation here...

I would like to configure my outbound SMTP mail server. i'm using Gmail for it.
So, i use "smtp.gmail.com" in SMTP server, i chose 587 as the smtp port, and i tried both SSL and TLS.
My gmail address and gmail password are correct.

But yet, when sending the test mail, i got this error message :"Erreur emailing :Failed to connect to outbound SMTP Mail Server"

I've search for the imap in Php5, and i do have IMAP enabled. I don't know what to do, and i'm totally confuse and at a dead end : i'll use the outbound a lot, and i need to receive email too !

I'm kind of in a hurry with a seems-to-be unresolvable mess.

Could you help me please ?

My configuration :
- SugarCRM Professional, Version 7.5.2.1 (Build 1008)
- PHP version 5.3.23
in php info, in "Configure command", i have "--with-imap-ssl", and in Protocol, i have imaps and imap.

Please, please help me !

Thanks a lot for your time !