It's an interesting question, and the answers depend on what style you're aiming to compose and where you are as a beginner. Here I'll list five basic elements, and these elements assume an understanding of basic theory (like pitch and notation).
One could make a good argument that the most influential aspect of most music is the melody. Sure, there are pieces where harmony or rhythm are more important, but more often than not it's the melody that tends to get stuck in our heads long after the piece is over. There's just nothing like a beautiful melody.
In the Classical era, good melody writing fell under the purview of counterpoint. Counterpoint is still taught today, but it's often taught very different than it was, say, in 1770.
In many respects, harmony also once fell under the umbrella of counterpoint. (See How is counterpoint different from harmony?) But learning proper harmonic progression, and how to trigger particular emotions with harmony, seems paramount.
It's true that rhythm hasn't always been the most important musical element; one could certainly make the claim that it didn't really achieve much prominence until about the second half of the twentieth century. But proper understanding of rhythm (and meter) and how rhythms coincide (and work against each other) is vital to creating whatever effects you're seeking.
The inherent emotional content of form is often overlooked; composers throughout history are on record emphasizing the meaning behind their formal structures. And this isn't something limited to classical music; form in popular music is equally interesting, if not moreso.
One can be a great composer and have relatively little knowledge of orchestration, but clever orchestration can make all the difference in the world. Check out this piece, originally written for piano. Now see what a difference this orchestration makes. Or perhaps this segment compared with this orchestration makes the difference even more clear.
Of these, notice that all five really fall under the purview of music theory. Understanding good melodic writing, especially in terms of counterpoint, is music theory. Harmony, rhythm, and form are all absolutely essential music-theoretical concepts taught to every undergraduate music major. One could perhaps make an argument that orchestration falls outside the category of music theory, but I'll offer a (perhaps silly) rebuttal: every university I've ever seen lists orchestration as a music theory course.