When did the practice of making an official "declaration of war" cease? In the sense of an ambassador being formally received by the foreign ministry either with the declaration itself or with an ultimatum. And then both sets of embassies being withdrawn.
There's a detailed description here of ambassador Neville Henderson being received by the foreign ministry in Berlin. Perhaps the most famous example.
This site has a description of Ciano handing out declarations of war "dressed as a major in the Regia Aeronautica" on June 10th 1940.
The last examples of this kind of formality and correctness which I can think of occurred during WW2.