When and how is it appropriate for an undergraduate to email a professor out of the blue?

This may not be appropriate for MathOverflow, as I haven't seen precedent for this type of question. But the answer is certainly of interest to me, and (I think) would be of interest to many other undergraduates.

Often, while seeing some lecture online, or reading lecture notes from the internet, or hearing about someone who is an expert in a topic I'm interested in, I feel as though I want to email the professor in charge of whatever I'm looking at or hearing about. Usually this is about some question; these questions can range from the very technical to the very speculative. In the past, when I have mustered up enough guts to actually email the question, I've had good results (question answered, or reference given, etc.) However, every time I send a question I get the same sort of anxiety of "I have no idea what I'm doing!"

So here are my questions:

1. When is it appropriate to email a professor (that you don't know) a question about their work? (Remember; I'm an undergraduate, so these questions have a high chance of being inane in one way or another).
2. How should this email be formatted? Do I give my name in the first line? Or do I give a bit of background, ask the question, and sign my name. (The latter is what I have been doing).
3. How specific should the subject line be in order to increase the chances that the email gets read?
4. Should I mention anywhere in the email that I am an undergraduate?
5. This one is kind of silly, but I always have trouble deciding what to do: Suppose that I've emailed a professor, and they email me back with some answer... is it appropriate to email back with just a "Thank you"? I always feel like I'm wasting their time with such a contentless email, but at the same time I do want to thank them... Actually, in general I feel as though my questions are a waste of the professor's time (probably what feeds the email anxiety)... which brings me to:
6. If you happen to be a professor who has received such emails in the past; are they a waste of your time? Please be honest!

EDIT: Small new question...

1. If you receive a response and the professor signs with their first name, are you supposed to refer to them by first name the next time you email them?

Once again, if you think this is an inappropriate question, I totally understand. But please start a thread on meta to discuss it, because I think this might be borderline, at least.

-
I think this is an interesting and well-though-out question, and deserves to stay open. –  David Hansen Aug 4 '10 at 18:22
Community-wiki though? –  Harry Gindi Aug 4 '10 at 18:24
@Dylan - My answers: 1. Always. There is no such thing as a stupid question. 2. Either is fine. 3. "A question regarding X" suffices. 4. Probably a good idea. 5. A thank you note will be briefly appreciated, and then deleted. 6. No. –  Sam Nead Aug 4 '10 at 18:32
This is a fine question for MO! As far as first name stuff, my policy is that whenever I write someone I don't personally know, I address them as Prof or Dr so-and-so. Once they sign an email to me with their first name, I'll usually use their first name, but there are some exceptions (eg there are some older Japanese professors who I always address as Prof so-and-so even though we're on very friendly terms and they address me by my first name). You just have to be a little culturally astute, but in the US, at least most young people don't mind being addressed by their first name. –  Andy Putman Aug 4 '10 at 18:55
Dear Dylan, I think that Noah's answer contains valuable advice. On a related note, while it is perfectly fine to email people asking questions (there are very few people who will be bothered by this; at worst you won't get a reply, but I think that typically this would be more a sign of a lack of time and/or disorganization rather than incivility/rejection), there is also a lot to be said for learning how to use the literature to answer your questions. This is part of how you train yourself to do mathematical research. –  Emerton Aug 4 '10 at 19:25

I am a graduate student, so I can only provide you the point of view of someone who has (and still does) asked vast amounts of questions to all kinds of people, both in person and by e-mail. I think some of my experiences might be useful to you, though hopefully you will get the point of view of someone who is on the receiving end of these sorts of questions. I don't know how best to organize my thinking on this issue, so I'll just make a list of do's and don'ts.

• My number one piece of advice is to not be bashful about asking questions. I can completely understand the insecurity, but I have never once in my life had someone get upset at me for asking a question (even what turned out to be a stupid one). The vast majority of the time, the person you ask is extremely flattered that you are interested in their work and enthusiastic that you have provided them with an opportunity to share the fruit of their sweat and tears with someone. And you can learn things from communicating with experts that don't appear in any book.
• Be polite. This means fully introducing yourself - I usually give my full name, current academic institution, and status (in your case, undergraduate). You can also inform them how you stumbled upon their work. Be sure to thank them for your time, just like you would anyone else whose help you are soliciting. I also think it's a good idea to write a short "thank you" e-mail if you get a helpful answer.
• Be formal, but don't overdo it. Do your best to use proper grammar and punctuation (including capitalizing letters, etc.) - this is required if you want your message to be taken seriously, and some people are very finicky about this sort of thing. But you don't really want to sound like a lawyer either.
• Be concise. If you have a ton of questions, pick a few that are most important (and which go most naturally together). Write only what is necessary to enable a complete and intelligent answer - your audience probably doesn't want a huge reading project. If you get a helpful answer, you can always write back.
• Be precise. Whatever mathematical language you need to use, make sure you are using it correctly. Make sure that your questions are written clearly and that they make logical sense. You should also provide a reasonably specific title for your e-mail.
• Try to ask the right questions. Your questions should have a clear and definite answer ("Can you explain what l-adic cohomology is?" is not a good question; "Do you know a counter-example if condition X is removed in theorem 5.2 of your book" is a good question). Also, your questions should be appropriate for the person to whom you are writing; don't e-mail Andrew Wiles with a PDE question, and don't ask Hartshorne how to solve one of his exercises. I think it is perfectly appropriate to ask and expert for references if you are interested in a somewhat obscure topic, but don't ask "what do you think would be a good introductory functional analysis book?" Finally, never ask a question that requires someone to do a long computation for you.
• Make a reasonable attempt to exhaust your other resources before you e-mail someone you don't know, and briefly outline what you did (e.g. who you asked or what you read). If you just read the Wikipedia page on gauge theory and you don't understand something, talk to people in your own department and look through some books before you e-mail Ed Witten. Also, look around on the webpage of the professor in question for lecture notes or survey articles that they might already have written; you may find that he or she has already anticipated your question.
• Keep an open mind. Sometimes you'll get a one line answer; sometimes you'll get a three page essay. I think it depends more on the style of the person answering than the nature of your questions.

I hope you find this helpful!

-
I found this very helpful! Thank you! I especially like the part about trimming down the number and range of questions... I have certainly been guilty of going into daydream territory with my questions ("And what happens if we do X? Or if we try to generalize to all Y? Why not just Z!?) –  Dylan Wilson Aug 5 '10 at 16:44
Totally agree with the last point of this post. –  Somnath Basu Aug 5 '10 at 17:27
Regarding the last point, I once had a professor hand write a two page proof, scan it, and then send me that as a response. He said it was much faster to do that than type it up or try to make me read non-texed latex in the email. Luckily it was legible. I was quite shocked at the format, but it worked. –  Matt Aug 31 '11 at 19:28

Andrew Stacey covered this briefly, but I want to re-emphasize:

If you are an undergraduate it is unlikely that you have questions that actually require asking the expert in something. If you're at an institution with a graduate program (this may be different at a liberal arts college) you ought to be able to find someone local you can ask instead. This way you can talk in person (which is an easier way to communicate), you can ask during someone's office hours (when they're in their office answering questions anyway), and you're building connections with professors at your school who might write you letters in the future.

Furthermore, if the professor you ask locally doesn't know the answer, they'll be able to point you to a friend of theirs who will know the answer. That way you can start your letter "Hi, I'm a student at school X and Prof. Y suggested you might know the answer to the following question."

In graduate school things are a bit different, you're more likely to have a question that really does need to be asked of a particular person, and you're more likely to know whether the question is a good use of that person's time. Furthermore, as a graduate student you'll want to start getting to know the experts in your field at different schools. So, if your advisor doesn't know the answer to a question you shouldn't hesitate to email someone who you think would know the answer.

-
"you're building connections with professors at your school who might write you letters in the future" - IMHO this should never be the first (or second, or even third) thing to have in mind when approaching a prof. –  Marcin Kotowski Aug 5 '10 at 11:25
Well, it does need to be on your mind at some point. I don't think Noah is advocating this as some kind of nefarious scheme, but meeting and talking mathematics with professors other than your advisor is a very important thing for graduate students to do, and something which is a bit intimidating, and which some people need some pushing to do. –  Ben Webster Aug 5 '10 at 12:49
When you wake up in the morning, and don't want to get out of bed, it's useful to think "If I don't put on pants and get out of the house, I could be fired and end up a hobo. I guess I'd better put the coffee on." That doesn't mean you're only doing your job to avoid hobodom, or even that it's your main reason. But incentives matter, and graduate student should keep in mind that there are strong incentives to talk to a variety of older mathematicians, in the long term, even if it's intimidating now –  Ben Webster Aug 5 '10 at 12:53
+1, Ben. I especially liked the word "hobodom". –  Harry Gindi Aug 5 '10 at 13:49
I certainly don't want to encourage people to become grubbing careerists who put cynical networking ahead of mathematics, but I do think it's important for people to think about their careers. It's much easier to only talk to other students and never interact with professors, and if you do that it's going to hurt you in the long run. So why not be aware of that dynamic? –  Noah Snyder Aug 5 '10 at 15:50

It may be helpful to read the perspective of someone reasonably senior (alas!), so here it goes.

Although I do not remember getting emails from undergraduates, I do get occasional emails from PGs, postdocs and other researchers in my community whom I have never met or heard from before. If the message is addressed to me and is clearly not spam, then I will invariably respond, if only because I think it polite to do so. However the type of response can depend on a number of factors.

For me to truly engage with the email, it has to satisfy a number of criteria. First of all, it should be clear that the message is serious, that the sender has done her/his homework, and that the tone is polite without necessarily being too formal. It helps to feel that I am "uniquely" (whatever that means) qualified to answer the question. Usually this means that question refers to something I have written.

If I know that the question is answered in the literature, I will point to the relevant sources with some commentary and perhaps a short guide to the literature. On the rare occasions I cannot get away with that, I will send a detailed answer.

It's nice to receive an acknowledgment of receipt, if only to say 'Thanks'. I almost always sign my emails with my first name, and hence I will not get offended if the next email is addressed to me in that way.

I prefer plain text email to HTML, institutional email addresses to sophomoric_name@hotmail.com, and I'm more likely to take seriously emails which are succinct, carefully punctuated, and have correct spelling and grammar.

And of course it is important to know at which stage in their career the sender finds her/himself, if only to know at which level to pitch the response.

-

Whenever I write to a professor or researcher who I don't know in person, I make sure to write a formal letter. For the first letter, I introduce myself briefly (I'm an undergraduate at university of michigan, my research interests are mainly higher category theory, categorical homotopy theory, and commutative algebra, etc.) (just don't make it too long) and explain why I'm writing him or her. I make sure that I've done my homework (see the MO FAQ/howtoask page) and explain why I'm writing (oftentimes, it's that nobody in the department is working on the things I'm trying to learn, so it's very hard for me to just ask for some help in person).

I make sure that the recipient knows that I understand that he or she is probably very busy, and that I really appreciate him or her taking the time to read my e-mail. Then I ask the questions I'd like to ask. I think it's best to keep all of your communication very formal until you've met in person. The professor/researcher you're emailing is doing you a big favor by explaining a point that is probably trivial in the grand scheme of things.

I don't know if these are necessarily always the right things to do, but I've always gotten a good response by doing it this way. Most professors and researchers seem to be very happy that you're reading their work, and as long as you're not annoying them, they seem pretty happy to discuss it.

-
Thank you, Harry, for addressing the problem of "How formal should I be?" That's another one that I always wonder about. A specific query in that regard: If they return your email and sign it with their first name, does that mean you're supposed to call them by their first name? I'll add that to the main question as well... –  Dylan Wilson Aug 4 '10 at 18:46
You've just reminded me that you once wrote to me asking for help with something in differential topology and I remember thinking that the email was a bit formal (to make it clear to others: this was after I already knew Harry through here and the nLab)! But I agree that it's best to be over formal than over polite. Maybe you should copy that email here as a template! –  Loop Space Aug 4 '10 at 20:41
I meant "best to be over-formal than under-polite". Whoops! –  Loop Space Aug 5 '10 at 7:40

(I'm in a mellow mood - plus one benefit from MathOverflow is that I have gotten a few emails from people "out of the blue" that I wouldn't have gotten otherwise - so I'll have a shot at answering.)

1. When the question really is about their work. It's very easy to ask a question that isn't about their actual work - for example, if there's a bit that you don't understand then it might be a core bit of the work (in which case, it's okay to send the email) but your confusion might be based on a misunderstanding of something more basic (in which case, don't). To figure out the difference (as that's not always easy), ask someone nearby (ie someone in your university who is therefore paid for answering your questions, allegedly) who's in a similar area. If they can answer your question, great. If not, send the email.

The situation is slightly different if the question arises from some lectures. Unless they are very specialised lectures, it is unlikely to be directly related to the person's work.

3. Very. But remember that many email programs truncate the subject line (often hilariously) so: "Question about arXiv:0822.2225" or something like that.

4. Absolutely! I would view this as already being "on the inside" so I'm more inclined to help, and it tells the person a bit about your background so they know what to assume or not to assume in their reply.

5. Absolutely. Profs are human too (so I'm told). "Thank you for your help" can make someone's day.

6. Not actually a professor, but I'll answer anyway! No, such emails are not a waste of my time. I'll admit that I don't tend to get many from undergraduates from other institutions, but I do get a few from graduates. Getting such an email is nice because it tells me that there are other people thinking about similar things to me, and so that my work isn't being completely ignored (it's often hard to tell that otherwise). Particularly, after a day answering banal questions on MO (okay, exaggeration for effect), it's nice to get a question that is actually about something that I'm (supposed to be) an expert on.

That said, don't flood people with questions! Try to remember that such questions are similar to MO - you're asking someone to do you a favour with no real hope of return. Most people are nice and will do their best to help, but make it easy for them to do so. The MO FAQ is a good thing to read: if it would make a good MO question, but you happen to know exactly who's the right person to answer it, you could send them the question (possibly with posting on MO as well? And if they're known to use MO, why not post the question here and send them an email simply saying "I asked this question and I wanted to bring it to your attention as I suspect you'd be the best at answering it.". Bit of flattery, plus as it's on MO, if the person really is too busy then they don't feel too guilty if they can't answer it since someone else will probably have a go. Making it easy again.).

-

Dylan, this is a very good question, and you got really excellent advice. I have received emails from (Italian) undergraduates and graduate students asking me how to solve random exercises; furthermore, it was obvious to me that they were not just emailing me, but several other people. They did not even write my name in full, their emails would start with something like "Hello!". These are really irritating; I write to them to point out how inappropriate their behavior is, but they never seem to get it. The last one (who was completely unknown to me) replied that "being a teacher is a vocation", reproaching me for not being very happy help her solve her linear algebra problem.

Now, obviously you would not do this. Let's assume you are writing to me. I always try reply to thoughtful questions related to my work, or to something I wrote, or to something I am expert in (as an example, don't email me with questions about group theory: if they are hard I won't be able to answer, if they are easy I will seriously wonder why you can't ask one or your teachers, or someone else closer to you). I make exceptions for students from the third world.

Introducing yourself is good, but don't make it too long. The way you have been doing it is fine. Try not to be long-winded, but give all the essential details (of course, this is not easy for someone who is not experienced, so you will get plenty of leeway from me). Also, give me some idea of your background, so that I know what kind of knowledge I can assume.

If your question is very easy and not very interesting to me, expect a concise answer: if after thinking about it you still don't get it, you should feel free to write back, explaining to me more precisely what your problem is (I mean, simply repeating the question won't do, but something like "I tried what you suggested, I can see that $X \to Y$ is smooth, but since the map $U \to V$ is not a pullback of $X \to Y$ I don't see why this implies that $U \to V$ is smooth" will work). If you manage to ask an interesting questions, so much the better, and you will get a more extensive answer, and impress me as a bonus (you never know when having impressed someone might be useful).

I very strongly advise thanking afterwards. It is polite, and creates good will. I find the idea of spending time writing an answer that is not even acknowledged very unpleasant. If you don't thank me, you are much less likely to get a reply the second time.

I always sign with my first name, and don't mind it all if you use in subsequent emails (as a matter, I prefer it, but if you feel uneasy doing this then don't, that's fine too).

Don't be shy. Spend time thinking about what you are writing, but keep in mind that you won't be held to the standards of professionals mathematicians. In any case, the worst that can happen is that you don't get a reply.

-
Thank you, Angelo! This was very helpful. –  Dylan Wilson Aug 5 '10 at 16:39
I would get these questions from time to time. Someone sending emails all over the world, hoping some professor somewhere would do her homework problem for her. –  Gerald Edgar Aug 5 '10 at 20:45

First of all, MathOverflow gives you a great glimpse of how and when to ask mathematicians questions. This site has a fair mix of professors, postdocs, and graduate students, along with a few others. So as I think you can see, most mathematicians (maybe not quite all) like to answer questions. The only real issue is to write the question so that the recipient will enjoy answering it.

Yes, you should introduce yourself and be polite. However, only in an efficient, common sense way. I for one really don't like toe-kissing and self-deprecation before a math question. It can be worse than rude, cryptic e-mail with no introduction. Here is an example of a turn-off introduction...

(1) Hi, I'm just a lowly undergraduate and (2) I'm not very good at math. (3) I'm sure that you are really busy and that (4) this is a stupid question. (5) What does it mean to have a manifold such that..."

...annotated with my private reaction:

1. I'm not that elitist; at least, I hope not.
2. People who like math do not enjoy such disclaimers.
3. Actually, I struggle with procrastination just like most people.
4. Is that meant as a warning?
5. Finally, something that I might enjoy reading.

What is important, as you can see from MO and as Jose says, is to put some thought into the question, and to have a reason to ask Professor X and not someone else. I don't think that you should belabor either issue; brevity helps with both clear prose and good manners. Although I basically agree with Jose, I don't know that you have to be all that super-serious. What is bad is when you want someone else to think harder about a question than you did. I'll never forget this bizarre verbal question that I once got from an undergraduate, although in fairness it was an innocent and temporary mistake on his part:

Him: Can a prime have a non-trivial?
Me: I'm totally lost.
Him: I'm taking abstract algebra.
Me: Do you mean then, a cyclic group of prime order?
Him: Yes, exactly. Can it have a non-trivial? I think that it can't, but I'm not sure.
Me: I'm still lost. Prime cyclic groups are non-trivial in a lot of ways.
Him: (surprised) So it can have a non-trivial?
Me: No, I mean, a non-trivial WHAT?
Him: Oh! A non-trivial SUBGROUP!
Me: Then you're right, a prime cyclic group has no non-trivial subgroup.

(I was not teaching algebra at the time, so this was really out of the blue.) Anyway, the point is that it's important to ask a question properly.

As for the second issue, why ask X instead of Y, there are several ways to score a direct hit: e.g., if the question comes from X's paper, or if you mention that Y referred you to X. But I don't know that it has to be a direct hit to be a reasonable e-mail question.

Maybe a bare thank you response with no other content is a bit thin. You're right that it's good to thank people. What you can do in a thank-you response is to say something about how well you understand the answer or how you plan to use it. Possibly a bare "Thanks!" could come across as dismissive, although this is not usually a serious concern.

-
Perhaps I should explain my poor choice of words. When I wrote that I'd like a reply if only to say 'Thanks', I didn't mean that it should literally only contain 'Thanks', but I do think it polite to receive some sort of acknowledgment that the message was received, even if that is the end of the conversation. Personally, though, without any further information on my correspondent, I would never assume that a simple "Thanks!" was dismissive. But then again this may be cultural. –  José Figueroa-O'Farrill Aug 4 '10 at 22:29
Hi Jose. I actually had in mind only the original question in that paragraph. I don't see that there is anything wrong with your choice of words, and I suppose that my phrase is a bit overstated. –  Greg Kuperberg Aug 4 '10 at 22:59
"May I ask you a stupid question?" - "You just did!" (apocryphal). –  Victor Protsak Aug 5 '10 at 1:33
I studied with someone who is now a professor in Princeton that used to start any question with saying this is probably a stupid question. In most cases the lecturer would stop to think for a few minutes before answering it. So I wouldn't take such a statement too seriously. –  Yiftach Barnea Aug 5 '10 at 7:01

EDIT, Thursday. Maybe someone has mentioned this idea. I have, often enough, typeset the letter I have in mind in Latex letter document style. Then I send the email with my best ordinary text version of that, but point out that I have also attached a more readable pdf. I sent you a sample a few minutes ago.  ORIGINAL:Let me expand on a single point of Andrew Stacey, about not flooding people with questions. I have been on both sides of that one. Other people have bombarded me with questions, and this has led to some joint papers. In the other direction, I asked too many things of one guy, and eventually got a very polite but clear message to leave him alone. So, especially as an undergraduate, you need to bear in mind the possibility that the reply may not be enough ("Oh, that is covered by my 1000 page article somewhere") but a second email might nevertheless not be welcome. Or a fourth email might not be welcome after three went quite well. With any luck, it will be possible to decipher the professor's emotional response to your correspondence. That caution being said, I can't say anyone has reacted badly to a first message from me, just sometimes there has been no answer. Anyway, you can always write to me.

-
As a postdoc, I once got a "please don't bother me anymore" after only a couple of emails, so it happens at all levels. –  Loop Space Aug 4 '10 at 20:45
1. I know a couple of professors who are very friendly in person but never bother with email. Not sure whether that means that the $\textit{first}$ email is not welcome! But email can hardly replace conversation and discussion in person! 2. Don't read too much into "emotional response" (this is addressed to undergraduates who read this, not to Will). I've seen colleagues in situations where various pressures are so great that a person may simply postpone and forget replying even to people they knew! (I've been there myself, too). –  Victor Protsak Aug 5 '10 at 1:28
Right, it is also true that some people take a long time over email. It wasn't that way when it was a new thing, but then spam became prevalent, various other things came into play over time, and what had previously been paperwork involving actual paper became chores done by email. So there is an element of randomness involved around whether a professor keeps up with the mail queue. I don't think I will edit out the emotional response phrase, but Victor has a point. Certainly I would not have known, as an undergraduate, how to read between the lines of a letter of any sort from a professor. –  Will Jagy Aug 5 '10 at 6:05
Will, If by spam you also understand most of the institutional emails one gets in a university, then I'm in complete agreement as to spam being the fundamental reason why I don't email as much as I used to. –  José Figueroa-O'Farrill Aug 5 '10 at 12:42
Thanks for the offer, and the wonderful advice! –  Dylan Wilson Aug 5 '10 at 16:42

The reasons I became a math professor are that I love mathematics and I love helping students.  I constantly try to elicit questions from my own students.  I would be delighted, not annoyed, to receive e-mail from a student who was sufficiently interested in something I had said or written to send me comments or questions.

-

Let me also try to answer the questions:

So here are my questions:

1.When is it appropriate to email a professor (that you don't know) a question about their work? (Remember; I'm an undergraduate, so these questions have a high chance of being inane in one way or another).

If you have a research level question about a professor's work or related to his or her field of interest it is appropriate to email.

2.How should this email be formatted? Do I give my name in the first line? Or do I give a bit of background, ask the question, and sign my name. (The latter is what I have been doing).

You can first introduce yourself. You may give the background to the question. Try to be clear and rather brief.

3.How specific should the subject line be in order to increase the chances that the email gets read?

As informative as possible, "A question about convex bodies", "Are there only finitely many smooth toric varieties" "An idea related to the Erdos-Faber-Lovasz conjecture".

4.Should I mention anywhere in the email that I am an undergraduate?

Yes. If this is a good research level question it will will be impressing and if not it will not harm.

5.This one is kind of silly, but I always have trouble deciding what to do: Suppose that I've emailed a professor, and they email me back with some answer... is it appropriate to email back with just a "Thank you"? I always feel like I'm wasting their time with such a contentless email, but at the same time I do want to thank them... Actually, in general I feel as though my questions are a waste of the professor's time (probably what feeds the email anxiety)...

Yes. email back with "thank you".

which brings me to:

6.If you happen to be a professor who has received such emails in the past; are they a waste of your time? Please be honest! EDIT: Small new question...

I have received quite a few of emails from undergraduates. Usually it is not a waste of time.

7.If you receive a response and the professor signs with their first name, are you supposed to refer to them by first name the next time you email them?

No.

-
I agree with all these, Gil, except for 7. There are many times in life when I'm unsure how to address someone in an email. Almost always it would be easiest to be on first name terms, and as soon as the other person signs their mail by their first name, I take that as a clear signal that it's OK to switch. Isn't that reasonable? Conversely, when I'm mailing undergrads I don't sign myself "Tom", because I don't want them to address me that way. –  Tom Leinster Aug 31 '11 at 17:49
I agree with Tom and Gil. If the person uses only their first name, that is a clear signal it is ok for you to do so also. However, unless they ask you to use their first name, you can continue using the more formal title if you so choose. –  Pace Nielsen Aug 31 '11 at 18:18
Regardin 7, I think you are certainly not supposed to refer to them by first name the next time you email them, and, in fact, in the circumstences of the question I would recommend not to. –  Gil Kalai Aug 31 '11 at 20:18

I think the "when" part of the question has been well-answered, so I will only comment on formatting and style, some of which has also been addressed.

One thing I have trouble with when emailing people is keeping my emails short. But it is much, much better, especially when emailing a busy math professor, to keep your email to one page in Pine (yes, lots of math professors still use Pine). So introduce yourself briefly --- "I am an undergraduate at Tech U interested in XYZ" suffices. Using formatting, like bulleted and numbered lists if you have more than a unique question, never hurts.

At least at first, the other important thing to do is be "academic professional". My rule when emailing anybody is to use their full name in the "Dear So-and-so", where "full name" means whatever's at the top of their academic website. Depending on the context, honorifics like Prof. and Dr. are more or less appropriate. I sign my emails with my first name, and then include a very short "sig file" with my full name, institution, and email address, and only the first time. For future correspondence, I'll use whatever name the person writing to me uses in their signature.

-
What's wrong with pine? :) –  Mariano Suárez-Alvarez Aug 4 '10 at 19:59
@Mariano: it's not mutt, that's what. –  Loop Space Aug 4 '10 at 20:44
Pine is a tree. (So is elm, by the way.) Only VM in the One True Editor is a worthy mail client :) –  José Figueroa-O'Farrill Aug 4 '10 at 21:15

Above answers give a precise description of what the email should look like, so just a general comment.

Profs are (usually) normal people, the fact they're higher in the academic hierarchy than you doesn't mean that they're some kind of semi-gods who smite mortals for wasting their time :). So the rules are the same as in any standard interpersonal communication (be polite and clear, use common sense, thank the person for his time etc.), the fact that somebody is a tenured professor doesn't make them a distinct kind of being that requires a special procedure. People are almost always very helpful (either because they're friendly or just flattered, it doesn't matter), the worst than can happen is not getting an answer, and even then it's usually because of lack of time. Even is prof gets annoyed by your poorly phrased email, he simply deletes it and won't take revenge ;).

The above might be obvious, but sometimes in our academic culture too much emphasis is placed on people's social/academic positions (with tenured professor elevated to some sort of semi-godlike being), which results in undergrads being scared or too shy to ask. Profs are more busy and knowledgeable, but other than that begin a prof doesn't, IMHO, entitle you to any special kind of respect (other than standard respect you should have for any person on any academic level).

Last point - it's always OK to ask, even stupid questions. Yes, you'll make a fool of yourself, but: a) the feeling only lasts for a while, b) I guess nobody will remember it (or think of you as "the one who always asks dumb questions"). It's better to be a fool for a while than to feign understanding and remain a fool.

-
Most professors I've met in person are at a completely different level than even the best graduate students I've met. I don't know when the transition happens, but it certainly does seem like a a transformation from mere mortal to demigod. –  Harry Gindi Aug 5 '10 at 11:29
Oh, my. I really feel like a demigod, nothing less. For me the transition must have happened when I was hit by a car and got a concussion, that's what unleashed my powers. –  Angelo Aug 5 '10 at 12:19
@Harry: Here is one estimate of such a transition time. en.wikipedia.org/wiki/Outliers_%28book%29 –  Steve Huntsman Aug 5 '10 at 15:50

I have contacted many professors as an undergrad. It helps if you have had some contact with them during coursework/tutorials. But it is certainly not a necessary condition.

The most important thing to remember is that Professors are people, too! They want to help undergraduates learn. They want to guide their education in whatever way they can. That is one of the main motivating factors in an often solitary academic landscape - the belief that their knowledge is being put to good use.

-

This is a very good question and the previous answers covered most of what I would have liked to say. So the only point I would like to add is that there is a huge difference in how busy professors are. So for instance I would be happy to receive an intelligent question related to my work. However, there are some well known people who are presumably bombarded with emails and I am sure a lot of these emails are very reasonable emails. So I would avoid writing to such people unless I exhausted all other possibilities first and I am also sure that what I am writing will interest them. If I have doubts, I will not write them.

-