Masturbation or oral stimulation can have the same effects on the heart as sexual intercourse. People can engage in these activities after a heart attack when it is safe to have sex again.