You can drink tea when you have an ulcer.
However when you do have ulcers it's best to avoid tea or at least avoid drinking too much tea when you have ulcers.
Tea contains Tannic acid and theophylline which can aggravate your ulcers because the Tannic acid and theophylline in the tea can stimulate stomach glands which can then increase the secretion of gastric acid and pepsin and directly participate in the chemical digestion process, so as to decompose food and promote digestion.
The disadvantage of drinking tea is that if you do not drink tea properly, it may cause bad stimulation to your stomach and intestines.
For example, drinking strong tea on an empty stomach can cause heartburn, nausea, vomiting, irritability, palpitation and shortness of breath, and people who are heavy can faint.
So it's best to avoid any tea and even coffee when you have ulcers until the ulcers clear up.
But if you want you can drink a few cups of tea and see if it affects you.
Some peoples ulcers are worsened when they drink tea and some other peoples ulcers are not affected.