Updated email sending code. Removed .php from urls as suggested by Conlectus