Innovate anywhere, anytime Your cloud-based dev studio.

Sendgrid Inbound Email Parsing with Django


Inbound Parse API follows 3 steps:

  1. sending an email to the mail id(URL_Name@your specified domain/sub

a Here the domain/ sub domain, where the emails will be sent, and the URL_Name, where we will handle the contents, attachments of an incoming email in our app. 

b. Here the domain/sub domain should point out the MX record to Here you can check weather your domain/ sub domain is having MX  record or not.

c. we should add domain/ sub domain, URL to our inbound parse web hook settings list.

For ex:
             mail id:

2. Sendgrid parses the content and attachments of an email and sends the information to the specified URL of your

3. You can receive the JSON post response to your application
         envelope = request.POST.get('envelope')
         my_dict = literal_eval(envelope)

You can get email from address form my_dict['from'], text(request.POST.get('text')), attachment details from

In order to test it in local server, You can use the following settings:

domain: is having an MX record)
        URL: Your App Url
        mail id: