I have frequent heart palpitations and it kinda worrys me but my doctor said it was due to caffeine and smoking. Does that sound right?

Nicotine & xanthines. Nicotine (in tobacco) is actually a neurotransmitter & is used by the body to tell the heart & vessels how to adapt. Methylxanthines (like caffeine) can interfere w/ this system, just like taking a mega-hit of nicotine (by smoking). Excessive caffeine intake is associated with (but debated as to cause of) atrial fibrillation, an irregular heart beat that can cause palpitations. Smoking helps no 1!