A virus is considered to be a piece of code that gets onto your computer without your knowledge and runs against your will. One common misconception among people is that you can infect your computer just by opening an email and reading it. That is not probable. It is generally the files attached to the email that has the virus.
Read more this article