Definitely check in with your health care provider before using viagra and heart medication. Viagra was accidentally discovered to work for ED when being studied for it's affects on the heart. They always ask you if you are taking this. Men taking ED medications can not take nitrates as a general rule.