Is it possible to get mastitis while not breastfeeding?

Yes. Mastitis is related to infection or inflammation of the breast. During nursing it is usually secondary to an infection. However you may get breast infection due to other causes other than nursing. In addition breast secretion within the glands and ducts is also irritant to the breast parenchyma and can cause mastitis if it gets out of the ducts into the breast tissue (chemical mastitis).