Say there is a student who writes a mail to a professor asking for a PhD vacancy or a RA-ship position. Should he attach his résumé in a mail to a professor?
I have had contradictory viewpoints on this. Some people ask not to attach résumés in such mails to professors, saying such mails go straight to spam. They instead prefer having a webpage and providing a URL. This is tough, as students (esp. undergrads) do not have a lot to share on a website. Moreover there is a contradiction: if a professor cannot view a résumé in her browser, what is the guarantee she would visit a website and click each of the sublinks? Looks more implausible to me.
There are others who advise applicants to provide a brief bio instead of a résumé or a URL. Again this could turn out awkward: in a bio, "I did my bachelor's in XYZ University" is fine, but "I was fourth in the Department during my bacheor's" looks out of place.
I do not mind getting a résumé attached to e-mails. However, a tendency I have noted is that I also tend to get scanned copies of assorted certificates sometimes numbering several tens of Mb files. There is no way I will run through such quantities of information. So if you send a résumé, make it brief and to the point.
As Aeismail points out, also make the mail itself concise and clear as to what you are looking for. It may seem like a lengthy mail may be more polite but remember that e-mails are typically used for brief messages. Your mail will end up as one of perhaps hundred on a particular day and a lengthy mail may be put in the "to do list" and postponed until enough time is free to read it (which usually does not happen).