Of course, people do it all the time. I will still recommend you to apply directly and after that send in the email, especially if you have a reference from the company you are applying to. It is super simple and don’t give it a second though, while I wholeheartedly agree that some people or companies that you are being desperate, most see it as an ambitious move.
Find the company’s email:- Most likely on their website, like you should email their contact email or better yet try resume@company.com and you will see that you might find something similar to it on the website.
Write an email (mentioning the reference if you have one):- You need to really specific about why you are writing the email and quite frankly, what you want from the company. Don’t wiggle around the line, just be upfront and tell them what you want and be respectful but smart and you should be fine!