Am I Forgiven If I Don't Go To Confession?
1917 Code of Canon Law: After the reception of baptism, if anyone, retaining the name Christian, pertinaciously denies or doubts something to be believed from the truth of divine and Catholic faith, [such a one is] a heretic...
1983 Code of Canon Law: Heresy is the obstinate denial or doubt, after baptism, of a truth which must be believed by divine and Catholic faith.
Generally, heresy is any unorthodox belief embraced by one who is called a Christian after the reception of baptism. These canons regard formal heresy, an ecclesiastical crime and sin (this is why it is addressed in the CIC). Material heresy is not corrected or condemned, and therefore, the heretic is not pertinacious. Though, if they do act with pertinacity when corrected, they will be a formal heretic.
"And whosoever shall not receive you, nor hear your words: going forth out of that house or city shake off the dust from your feet (Mt. x. 14)."