It is recommended that you use our PHP SMTPAPI library, full documentation can be found on Github. You can more deeply integrate with SendGrid by using our PHP API library.