Yeast infection and sex

I recently got a yeast infection just the cottage discharge no other symptoms so far but i had sex before i knew, i was wondering has anybody had sex with a yeast infection? Can men get it?