I heard this from a speaker once, and thought it might be beneficial to share. When it comes to interacting with the opposite gender, always keep these "3 Ps" in mind. Your communication should always be:

Public
Purposeful
Professional

Otherwise you risk falling into the doubtful and impermissible.