Working of electronic letter box circuit is very simple Install the LDR and LED on opposite side of the box so that light from LED constantly fall on LDR as a result device remain off because light is falling on LDR its resistance is low as a result pin 2 of IC1 goes high. Consequently output pin 6 of IC1 remains high then this high is supplied to pin 1 of CD4001 which is a NOR gate and it only gives output as1 when both the inputs are low (a we can see in truth table)so LED will continue to glow indicates that there is no letter in box.
As soon as anyone drops the letter light falling on the LDR is obstructed and its resistance goes high. As a result, pin 2 of IC1 goes low which also make pin 6 low and this low is supplied to pin1 of NI1 as a result we will receive logic 0 in output pin 3. Therefore we will receive logic 1 at output of pin 4 because 0 is passed to NI2 gate input from pin 3 so whatever may be the input from pin 2 we will receive high at pin 4. This means that we will receive 6V at pin 4.Now voltage on pin 8 is also high whatever may be the voltage on pin 9 we will receive low at pin 10 of NI3 which also make pin 12 and 13 of NI4 to low and we will receive high on pin 11 as you can see from truth table and LED connected to it will not glow. This means we have letter in box.