added mailing functionality