The immune system can also trigger the event. With many infections, the body will heat up, trying to make the infection as uncomfortable as possible.
Are you asking why people get sweaty, clammy, cool skin when they're having a heart attack? or if sweating more is linked to heart disease?
Either way, sweating is your body's natural reaction to being too hot. You sweat to cool yourself down. It's related to glands in the dermis of your skin that have ducts leading up to your skin's surface. When given the right trigger by your body, they release sweat to try to help you maintain normal body temperature. A lot of why a person sweats during an MI is due to that trigger being given. "Fight or flight" response is activated during such an event