almost finished mailing functions