added mailing function