Added a function to check for the posttype before saving and sending a mail

I got a lot of spam ;_;