Separate the send email function