The basic rule is that the publishers that will take unsolicited material are a waste of time.

Those publishers you can't get to, are the good ones.

Sending material to a publisher by mail is a 100% waste of time.

Like with any regular job, you need a resumé with credentials and a network of people who knows you, to have your music seriously considered.

Assuming you don't hang around musicians, artists and people in the music industry, you can build credentials and start to network with a handful of professional demos, writing songs every day, collaborating your way up the songwriter "ladder", collecting reviews of your music, showing up at network events.. ect.

It can be a long process, for some, easily 10 years of dedicated work. Faster if you are really talented, not only in songwriting, but also in the networking and marketing department.

There really are no shortcuts to building a good reputation and building a great network of likeminded people.

You can get around this to some extent, if you own all the rights to your music (both the composition, AND the performances/recording of it - which you usually do, IF it's self-written/composed/performed or done in collaboration, with no professional studio involved).

In that case you can pitch your music to tv/film publishers/libraries, and build credentials faster, IF your music is competitive with whats out there now.