Am I safe as long as I don’t open attachments?
No. Viruses come in many forms, which are discussed here on SaferPC.
The short answer is: viruses are not necessarily “files” but “content” – which may get to your system in many ways, the simplest of which is as a file attachment, but could also occur in literally hundreds of other ways.