Posted in by Tudipat 06:06Comments Off on SendGrid email integration with PHP
24 June 2016
SendGrid (https://sendgrid.com/) is preferred email solution of lot of small and medium size enterprises. As SendGrid’s website describes “SendGrid’s cloud-based email infrastructure relieves businesses of the cost and complexity of maintaining custom email systems. SendGrid provides reliable delivery, scalability and real-time analytics along with flexible APIs that make custom integration a breeze.”
This entry explains how you can easily integrate SendGrid in your PHP project.
Before you start, create a free account with SendGrid as you would need it in the sample code.
Next GIT clone Sendgrid’s PHP library. The command below would clone it in a folder named sendgrid-php.
Now we are all set. Let’s write a sample code to send a mail using SendGrid. Create a PHP file and paste the following code in it:
include('/path where we took git clone/sendgrid-php/SendGrid_loader.php');
$sendgrid = new SendGrid('sendgrid username', 'sendgrid password'); // username/pwd can be found in the SendGrid control panel.
$mail = new SendGridMail();
That’s it!! You are ready to mail the world using SendGrid
All content provided on this blog is for informational purposes only. Tudip Technologies provides no endorsement and makes no representations as to accuracy, reliability, completeness, suitability or validity of any information or content on, distributed through or linked, downloaded or accessed from this site. Tudip Technologies will not be liable for any errors, omissions, or delays in this information or any losses, injuries, or damages arising from its display or use of the information on this site. All information is provided on an as-is basis without any obligation to make improvements or to correct errors or omissions. This site may contain links to other websites. Tudip Technologies makes no guarantees or promises regarding these websites and does not necessarily endorse or approve of their content. You may not modify any part of the blog. The inclusion of any part of this blog in another work, whether in printed or electronic or other form, or inclusion of any part of the blog in another website by linking, framing or otherwise without the express permission of Tudip Technologies is prohibited. This site may not be used for any illegal or illicit purpose and Tudip Technologies reserves the right, at its sole discretion and without notice of any kind, to remove anything posted to this site. By using this site, you hereby acknowledge that any reliance upon any materials shall be at your sole risk.