How to detect 220 VAC voltage using an opto-isolator
You only need one 1N4148, and depending on the phase of the mains sine wave when it's initially connected to C1, C1 could easily pass enough current to wipe out the 1N4148 or the opto's LED. The reason is because C1's reactance will be too low to attenuate the switching transient's edge, so the transient will propagate into the circuitry downstream from the capacitor, as shown below.

I switched the mains ON at 90\$^{\circ}\$ in order to get worst case positive voltage out of C1, and the bottom three traces are the same as the top three except that I've zoomed into the left hand side to better show the transients.