Melamine (M), phenol (P) and formaldehyde (F) were used as raw materials to synthesize a melamine–phenol–formaldehyde resin (MPF) which was used as shell material to prepare a self-healing microcapsule with E-51 epoxy resin as the core, via in situ polymerization. Fourier transform infrared spectroscopy, environmental scanning electron microscopy and laser particle size analysis were used to characterize the surface morphology, structure and properties of the microcapsule. The influence of the reaction conditions on the properties of the microcapsule was investigated by orthogonal testing. The mass ratio between the MPF shell and the epoxy resin core was found to be 1.2:1.0, optimum pH for shell formation was found to be 3, the emulsification speed was 800 r/min, the acidification speed was 400 r/min and the acidification temperature was 60°C. Under these conditions, the prepared microcapsules are regular and spherical with a smooth, dense surface and uniform particle size with a normal distribution. The microcapsules remained well dispersed and did not aggregate. The orthogonal test revealed that the average particle size and yield of the microcapsules are mainly determined by the core/shell mass ratio, whereas the reaction temperature had a greater impact on the core content of the microcapsules. Although the best microcapsule samples showed poor anti-permeability in ethanol, they exhibited good thermal, isothermal and storage stabilities. This indicates that they may be stored at a constant temperature.