This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -X POST https://api.sendgrid.com/api/mail.send.json \ | |
-H "Authorization: Bearer SENDGRID_APIKEY" \ | |
-d "to=test@sendgrid.com" \ | |
-d "from=you@youraddress.com" \ | |
-d "subject=Sending with SendGrid is Fun" \ | |
-d "html=and easy to do anywhere, even with cURL" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// using SendGrid's Node.js Library | |
// https://github.com/sendgrid/sendgrid-nodejs | |
var sendgrid = require("sendgrid")("SENDGRID_APIKEY"); | |
var email = new sendgrid.Email(); | |
email.addTo("test@sendgrid.com"); | |
email.setFrom("you@youremail.com"); | |
email.setSubject("Sending with SendGrid is Fun"); | |
email.setHtml("and easy to do anywhere, even with Node.js"); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# using SendGrid's Ruby Library | |
# https://github.com/sendgrid/sendgrid-ruby | |
require 'sendgrid-ruby' | |
sendgrid = SendGrid::Client.new do |c| | |
c.api_key = 'SENDGRID_APIKEY' | |
end | |
email = SendGrid::Mail.new do |m| | |
m.to = 'test@sendgrid.com' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# using SendGrid's Python Library | |
# https://github.com/sendgrid/sendgrid-python | |
import sendgrid | |
client = sendgrid.SendGridClient("SENDGRID_APIKEY") | |
message = sendgrid.Mail() | |
message.add_to("test@sendgrid.com") | |
message.set_from("you@youremail.com") | |
message.set_subject("Sending with SendGrid is Fun") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// using SendGrid's Go Library | |
// https://github.com/sendgrid/sendgrid-go | |
package main | |
import ( | |
"github.com/sendgrid/sendgrid-go" | |
) | |
func main() { | |
sg := sendgrid.NewSendGridClientWithApiKey("SENDGRID_APIKEY") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// using SendGrid's PHP Library | |
// https://github.com/sendgrid/sendgrid-php | |
require 'vendor/autoload.php'; | |
$sendgrid = new SendGrid("SENDGRID_APIKEY"); | |
$email = new SendGrid\Email(); | |
$email->addTo("test@sendgrid.com") | |
->setFrom("you@youremail.com") | |
->setSubject("Sending with SendGrid is Fun") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// using SendGrid's Java Library | |
// https://github.com/sendgrid/sendgrid-java | |
import com.sendgrid.*; | |
public class SendGridExample { | |
public static void main(String[] args) { | |
SendGrid sendgrid = new SendGrid(SENDGRID_APIKEY); | |
SendGrid.Email email = new SendGrid.Email(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// using SendGrid's C# Library | |
// https://github.com/sendgrid/sendgrid-csharp | |
using System.Net.Http; | |
using System.Net.Mail; | |
var myMessage = new SendGrid.SendGridMessage(); | |
myMessage.AddTo("test@sendgrid.com"); | |
myMessage.From = new MailAddress("you@youremail.com", "First Last"); | |
myMessage.Subject = "Sending with SendGrid is Fun"; | |
myMessage.Text = "and easy to do anywhere, even with C#"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST https://api.sendgrid.com/v3/campaigns HTTP/1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// using Twilio SendGrid's v3 Node.js Library | |
// https://github.com/sendgrid/sendgrid-nodejs | |
javascript | |
const sgMail = require('@sendgrid/mail') | |
sgMail.setApiKey(process.env.SENDGRID_API_KEY) | |
const msg = { | |
to: 'test@example.com', // Change to your recipient | |
from: 'test@example.com', // Change to your verified sender | |
subject: 'Sending with SendGrid is Fun', | |
text: 'and easy to do anywhere, even with Node.js', |
OlderNewer