This was because the rfc822.h mail.h etc. files needed to be moved to the appropriate folders. For some reason they were in folders that were not in the path. Now everything works beautifully.