It can be due to a mammary abscess or mammary duct ectasia.It causes one or more of the ducts beneath your nipple to become inflamed and clogged with a thick, sticky substance that's green or black. You can feel relieved by applying warm compresses to your breast.
Taking aspirin or nonsteroidal anti-inflammatory drugs, such as ibuprofen, may help relieve some symptoms. If there is any sign of infection like tenderness, redness or warmth over the breast or any associated fever, then antibiotics have to be prescribed. In very severe cases, surgery of the duct may be required.
It is very difficult to precisely confirm a diagnosis without examination and investigations and the answer is based on the medical information provided. For exact diagnosis, you are requested to consult your doctor. I sincerely hope that helps. Take care and please do keep me posted on how you are doing.