php hook for sending mail