Receiving emails via SendGrid

cdub picture cdub · Sep 12, 2012 · Viewed 9.8k times · Source

How do I use sendgrid to receive email and then be able to reply to that email from our domain? Like someone sends an email to [email protected] and we reply via [email protected].

Answer

bwest picture bwest · Sep 13, 2012

Take a look at this sample PHP application, the parseListener.php script in particular. It looks at the text of the email, rolls an arbitrary number of dice based on that text, and then responds to the requester with that many dice rolls.

In order to do something like this, you'll need to deploy that script somewhere accessible to the internet (a hosting company that supports PHP for example), update the code to use your SendGrid username and password, and then configure the SendGrid Parse Webhook to be pointed to the script, e.g. http://example.com/webhooks/parseListener.php