Well, arn't you glad you found out and is no longer the ignorant
girlfriend of a scum.
You really should thank your "friend" for letting you know about
this.. being aware is better than being in the dark the whole
time.
I'm pretty sure, the "enlightenment" that your boyfriend is a
scum does shows it wasn't your fault the relationship doesn't work
out, you can stop blaming yourself now. So your "frenemy" actually
did you a big favor.
Tell her next time she wants to share a boyfriend.. just say
so.. no need to sneak behind your back like a mouse.
Tell her you assume when she didn't log out of her email on your
laptop.. it was a discreet invite to share/view her emails, so you
gladly partake in her generosity and you are glad you did.