This file contains hidden or 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 "[email protected]" \ | |
-d "[email protected]" \ | |
-d "subject=Sending with SendGrid is Fun" \ | |
-d "html=and easy to do anywhere, even with cURL" |
This file contains hidden or 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("[email protected]"); | |
email.setFrom("[email protected]"); | |
email.setSubject("Sending with SendGrid is Fun"); | |
email.setHtml("and easy to do anywhere, even with Node.js"); | |
This file contains hidden or 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 = '[email protected]' |
This file contains hidden or 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("[email protected]") | |
message.set_from("[email protected]") | |
message.set_subject("Sending with SendGrid is Fun") |
This file contains hidden or 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 hidden or 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("[email protected]") | |
->setFrom("[email protected]") | |
->setSubject("Sending with SendGrid is Fun") |
This file contains hidden or 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 hidden or 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("[email protected]"); | |
myMessage.From = new MailAddress("[email protected]", "First Last"); | |
myMessage.Subject = "Sending with SendGrid is Fun"; | |
myMessage.Text = "and easy to do anywhere, even with C#"; |
This file contains hidden or 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 hidden or 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: '[email protected]', // Change to your recipient | |
from: '[email protected]', // Change to your verified sender | |
subject: 'Sending with SendGrid is Fun', | |
text: 'and easy to do anywhere, even with Node.js', |
OlderNewer