https://circuitdigest.com/microcontroller-projects/how-to-send-email-using-pic16f877a-esp8266 has complete details on how to use the code
This header file and C code can be used with MPLABX and XC8 compiler, for sending a mail using ESP8266 and PIC16F877A. The mail is sent using the SMPT2GO server. The librarey was originally developed by Camil Staps(https://github.com/camilstaps/ESP8266_PIC), then modified and updated for our usage