Once you’ve found a publisher or agent that interests you, you must work out whether or not they are legitimate before you submit to them.
Before I’d even consider submitting to a particular publisher I’d want to make sure that I could find a good selection of their books on the shelves of several bookshops, in as many different geographical locations as possible, as that would suggest they had a decent distribution system in place. If their books were only available online then I’d not even consider them, as they are not going to clock up many sales—most books are still bought in real, physical bookshops.
If I were looking for an agent I’d want evidence that they’d made good sales to solid commercial publishers, on behalf of several writers, and that they had sales successes in my genre: I wouldn’t even consider an agent who was just starting out unless he or she had relevant publishing experience, perhaps in rights sales or in a responsible editorial position.
Just do your homework before you submit, not after. Otherwise you could waste your precious time and money sending submissions to inappropriate places—or worse, end up getting tangled up with a vanity publisher or an incompetent or fraudulent agent.