Hi Milena!
Both sentences are correct, and people use them interchangeably depending on the situation. Actually, I would say the latter in most commonly used by native speakers.
Hey Milena!
Usually in spoken English, I skip the past perfect tense when referring to before or after. It sounds better in most cases to just say “After I read the message, I deleted it.” It flows more naturally. Hope this helps!
~Grace