emailContact() returning 500 error

I would have told you to check your code, variables, email id but the emailContact() function has been acting very unreliably this whole week. If you are concerned about performance use a 3rd party API to send emails. See this example on how to send emails with SendGrid.