working on mailing functionality