Reading another person’s mail or emails:
The famous Ashkenazi leader of the early middle ages, Rabbeinu Gershon Maor Hagoleh, instituted a Cherem [excommunication] against anyone who reads the mail of another person without permission. [This Cherem spread to all sects of Jewry, Sefaradim and Ashkenazim, and does not have a limitation in time. This Cherem is Halachically binding like any other law in the Torah, and according to some opinions carries Biblical weight. It is thus Halachically forbidden to read other people’s mail, or any private document that belongs to them or related to them.]
After the mail has been discarded: Once, however, the mail has been discarded, it is permitted to read it.
Opening without reading: It is forbidden to open the mail, even if one will not read the actual letter.
Mail of a gentile: This prohibition of reading another’s mail applies even against reading the mail of a gentile.
Reading someone’s email or messages [SMS/WhatsApp]:
Just as it is forbidden to read physical mail [i.e. snail mail] addressed to another person, so too it is forbidden to read electronic mail [i.e. email], as the prohibition was against reading information, and invasion of privacy, and not necessarily against the physical handling of another person’s mail.
Accidently received another person’s mail
One who received another person’s mail may not open it to read. He is to notify the individual who it was intended for, or simply write “Return to Sender” or “Wrong Address” on the mail not addressed to you and put it in your nearest mailbox.
Investigative work for the sake of a Mitzvah or criminal investigation:
It is permitted for a Beis Din, school, or parent, to look into another’s mail or private documents for the sake of their Torah education. Certainly, it is permitted to do so to prevent a crime and protect oneself and others from possible monetary loss or physical damage.
May one who received a letter or email from an individual reveal to others what was written?
One who received a private letter or email from an individual is prohibited from sharing it with others, unless he receives explicit permission from the sender. Accordingly, that which people are accustomed to forward private emails or messages to other acquaintances, may only be done if one has explicit permission from the sender.
Withholding someone’s physical mail [snail mail]: Under U.S. federal law, it is illegal to intentionally stop a letter from being delivered to its intended recipient, and that may include not informing the U.S. Postal Service that you have another person’s mail. If a person snatches a letter that isn’t addressed to them and opens it, they are committing mail theft. Intentionally doing so is a federal crime that could potentially land one in prison for up to five years.
Reading someone’s mail or email: The Fourth Amendment to the United States Constitution provides a privacy protection in the sense that “The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated.” The act of simply accessing and reading someone’s mail or email, without their permission can be considered a State or Federal crime, with civil and/or criminal liability, depending on the circumstances. [A major difference however in the secular law, versus Takanas Rabbeinu Gershom, is that in the secular law, it is not illegal to read a piece of mail that was left open, while according to Rabbeinu Gershom, doing so is not allowed.]
 Shut Maharam Merothenberg 1022; Kol Bo 116; Maharam Mintz 102; Beir Hagoleh Y.D. 334; Kneses Hagedola 334:5; Halachos Ketanos 1:59;173; 276; Toras Chaim Maharchash 3:46; Chikikeiy Lev Y.D. 49; Beis David [Salonica] Y.D. 158; See Encyclopedia Talmudit Erech Cherem Rabbeinu Gershom
The reason: Doing so is prohibited under several grounds: 1) Stealing: Reading another’s mail can be considered Shoel Shelo Midaas. [Toras Chaim ibid] 2) Migaleh Sodosav: It is forbidden to reveal the secrets of another. [Toras Chaim ibid; See Admur 156:14; Yuma 4b] 3) Rechilus: It is forbidden to search and investigate into another person’s private matters. [Halachos Ketanos 1:276] 4) Ahavta Lereiacha Kamocha: Whatever one does not want done to him he should not do to others. [Chikikeiy Leiv ibid] 5) Gneivas Daas [Chikikeiy Leiv ibid]
 See Maharik Shoresh 184; Mabit 2:46
The reason: As perhaps it has the status of a Shavua.
 Shut Maharam Merothenberg ibid
 Beis David ibid
 Chikikeiy Lev ibid
 Mishpitei Hatorah 92 based on Rashba 1:557
 Chikikeiy Lev ibid; See Admur 156:14; M”A 156; Semag Lavin 9; Hagahos Maimanis end of Hilchos Deios; Yuma 4b
 18 USC Section 1702
 One can be sued under the federal Stored Communications Act [18 USC section 2510-2701] and for invasion of privacy; See case Jennings versus Jennings No. 27177; see also here: https://arstechnica.com/tech-policy/2012/10/reading-someones-gmail-doesnt-violate-federal-statute-court-finds/