the second error is occurring because of the first error.
the first error is causing the header() function that is used to redirect to the thank you page to throw the second error.
If you fix the first error by referencing a valid SMTP server, you will also fix the second error.