Usually that error gives a line number and it means that you have a blank line or space on that line preventing a redirect below.
The email not being recieved is most likely a separate issue, since this error is more likely from the redirect below the email which should already be sent.