complete the automatic email sending feature