Should résumés be attached in a mail to a professor?
I slightly prefer attachments. The problem is that I'm reluctant to reply to e-mails asking for more information, or even to show up on server logs following links, because it may be interpreted as a sign of interest.
Like most faculty members (at least in technical areas), I get enormous numbers of junk e-mails regarding PhD positions or summer research. The general pattern is that they are form letters sent to large numbers of people, almost all of whom ignore the letters. If anyone replies in anything but the most discouraging way, then it inspires a potentially lengthy e-mail exchange that will probably just waste everyone's time.
This is a real problem, and I don't know what to do about it. It's not really fair, but right now the burden is on applicants to stand out from the junk e-mails. In particular, your e-mail should provide compelling proof that you spent at least as long thinking about it and writing it as you expect the faculty member to spend on it. If it looks like it could be a form letter with the professor's name and research topic pasted in, then I'll ignore it, as will many other people. [I should point out that I work in a department with centralized admissions, so I cannot accept students on my own. This is explained on my web page and the department's.]
For example, a clearly personalized e-mail that discusses the professor's research in detail is good. Keep in mind that plenty of people are trying to cheat with this. For example, I regularly receive e-mails saying something like "I found your paper X fascinating when we read it in our seminar", with no further details. This looks like a form letter, and there have been a couple of times when I've received e-mails from the same sender that were identical except for having different paper titles pasted in, with no indication that they had previously e-mailed me about another paper. Maybe a few e-mails are genuine, but they sure look like lies.
So when I get an e-mail regarding PhD admissions or summer research, I'm very skeptical that it's more than spam. There's a five or ten second window to convince me that it's different from the other e-mails, before I set it aside. If it looks promising, then I'll read further, and I'm a little more likely to do so if any information I need is available right there. So I'd recommend attaching whatever is needed.
Actually, I prefer to have the résumé or CV attached in the email. If there's not enough detail for me to decide if someone is going to be able to actively contribute to the group, there's no incentive for me to pursue the candidate further.
That said, if someone tells me in the body of the email something like: "I have done X, Y, and Z; and would like to do A and B using method C," then that's OK. At a certain point, the letter does provide enough information for me to determine that (a) the student is competent and (b) will be a good fit for my group. However, my response would be: "That's great—sounds like you're what we're looking for. Can you send me a CV and a list of references?" So we're right back to square one.
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).