SMTP PHP Code Example SendGrid recommends using our PHP SMTPAPI library, full documentation can be found on GitHub. Our PHP API library allows you to fully integrate with SendGrid. Rate this page: Need some help? We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the SendGrid tag on Stack Overflow.