make emailing work and add emailingtest. with jzhou31