Yosemite Mail will sometimes show Gmail outgoing mail as being offline when you first setup a Gmail account. To fix this open up Mail and do the following steps:
Open preferences and go to Accounts.
Select "Edit SMTP Server List" from the "Outgoing Mail Server Dropdown".
Select "Advanced" and put your account password in the password input.
Voila, all fixed.
For some reason, Mail doesn't always save the password here on setup, so these are steps required to fix it.