mail and link generation