I've never seen an ATM which took money in envelopes. Does it just take on trust the amount until it's verified by an employee counting it later?
The only way to "automatically" deposit cash was to put it into an envelope and then drop it in the machine. IIRC, you used to write the total amount on the outside of the envelope, together with your bank account information.
The machine was emptied at regular intervals, the envelopes were transferred to the bank, and an employee was manually opening them, verifying the amount, and credit your account.