|MadSci Network: Medicine|
Erections have occurred in strangulation cases and hangings, and no other to my knowledge. Basically, the blood pressure has to be increased in order to affect erection. Usually the erection goes away after death. As to ejaculation after death, I am only speculating, but I suppose it could be possible for several hours under the right conditions. It would require electric shock for a regular ejaculation, but rigor mortis on its own would only cause the fluid to seep out slowly.
Try the links in the MadSci Library for more information on Medicine.