The release of accretion energy during planetary accretion increases the temperature in the envelope of a growing protoplanet. The envelope can thus become hot enough to sublimate refractory minerals which are major components of the accreted pebbles. We calculate the sublimation lines of the most important refractory minerals during the growth of a rocky protoplanet. We find that envelopes of planets with M > 0.4 Earth masses reach temperatures high enough to sublimate all considered mineral species. We propose that the envelope thus becomes saturated with SiO above a temperature of approximately 1,350 K. Additionally, we calculate the sulfur concentration of a planet under the assumption that all sulfur is lost in the protoplanetary disk after the destruction of FeS by the reaction FeS + H2 <-> Fe + H2S at approximately 700 K. We demonstrate that the sulfur concentration of a rocky planet becomes a decreasing function of its mass. We compare our results to the sulfur concentration of Earth and Mars. While our values are in good agreement with the sulfur abundance of Mars, our model underpredicts the sulfur abundance of Earth. However, we show that the giant impact of a sulfur-rich body can lift the sulfur abundance to a value similar to the sulfur abundance of Earth. Our results therefore imply that the depletion of moderately volatiles elements, such as S, on Earth and Mars may be a consequence of planetary heating during pebble accretion.