Skip to content

Instantly share code, notes, and snippets.

@martyndavies
Created March 26, 2015 15:07
Show Gist options
  • Save martyndavies/25e4266bdb4e7c04391a to your computer and use it in GitHub Desktop.
Save martyndavies/25e4266bdb4e7c04391a to your computer and use it in GitHub Desktop.
// This is the example from https://github.com/sendgrid/sendgrid-php#headers
// but slight modifications have been made to include code for IP Pooling
$email = new SendGrid\Email();
$email
->addTo('foo@bar.com')
->addTo('bar@foo.com')
->setFrom('me@bar.com')
->setSubject('Subject goes here')
->setText('Hello World!')
->setHtml('<strong>Hello World!</strong>')
->addHeader('X-Smtpapi', {'ip_pool': 'pool_name'})
;
// Send it
$sendgrid->send($email);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment