SendGrid send email via IP Pool

Twilio SendGrid SMTP service can send emails via IP Pool, JSON string with SMTP objects. This is possible by including a header named X-SMTPAPI.  

The information about verifying and setting up an IP pool and associated domain with IPs.

When your setting is ready, i can create script to test email sending via right IP Pool.

Email example raw json without helper.

Code for Mail object

Don't be mistaken with

My own test script example

def create_message(self, item):
        current_site = Site.objects.get_current()
        from_email = Email(self.from_email)
        to_email = To(
        html = render_to_string('spontaneousmail/profilemail.html',
                                    { 'site': current_site, 'cyclus':item})
        content = Content("text/html", html)
        subject = item.job.title 

        email = Mail(from_email, to_email, subject, content)
        email.ip_pool_name = IpPoolName("POOLNAME_AS_IN_ADMIN")
        return email