I have been struggling with this and found that for SMTP server entering mydomain.com or mail.domain.com just gave me constant errors in Gmail...
However, after reading an article on another forum gave me the idea of using my server domain for the SMTP and Incoming server...