This example uses cURL with PHP through our web API to send an email.
<?php $url = 'http://sendgrid.com/';
$user = 'USERNAME';
$pass = 'PASSWORD';
$params = array(
'api_user' => $user,
'api_key' => $pass,
<?php | |
include_once "lib/swift_required.php"; | |
/* | |
* Create the body of the message (a plain-text and an HTML version). | |
* $text is your plain-text email | |
* $html is your html version of the email | |
* If the reciever is able to view html emails then only the html | |
* email will be displayed |
using System; | |
using System.Collections.Generic; | |
using SendGridMail; | |
using System.Net; | |
using SendGridMail.Transport; | |
using System.Net.Mail; | |
namespace EmailTester | |
{ | |
class MainClass |
require 'digest/md5' | |
module Jekyll | |
# Add accessor for directory | |
class Page | |
attr_reader :dir | |
end | |
class NavTree < Liquid::Tag | |
def render(context) |
require 'faker' | |
require 'csv' | |
CSV.open("output.csv", "wb") do |csv| | |
i=0 | |
until i == 25000 | |
fake = [Faker::Name.name, Faker::Internet.email] | |
csv << fake | |
i=i+1 | |
end |
This example uses cURL with PHP through our web API to send an email.
<?php $url = 'http://sendgrid.com/';
$user = 'USERNAME';
$pass = 'PASSWORD';
$params = array(
'api_user' => $user,
'api_key' => $pass,
#How to: Create an email
Use the static SendGrid.GetInstance method to create an email message that is of type SendGrid. Once the message is created, you can use SendGrid properties and methods to set values including the email sender, the email recipient, and the subject and body of the email.
The following example demonstrates how to create an email object and populate it:
// Create the email object first, then add the properties.
var myMessage = SendGrid.GetInstance();
require 'rubygems' | |
require 'pony' | |
#set the default options | |
Pony.options = { | |
:from => '[email protected]', | |
:via => :smtp, | |
:via_options => { | |
:address => 'smtp.sendgrid.net', | |
:port => '587', |
require 'rubygems' | |
require 'json' | |
require 'nokogiri' | |
require 'nokogiri-pretty' | |
require 'fileutils' | |
module Jekyll | |
module PrettyPrintFilter | |
def pretty_print(input) | |
#seeing some ASCII-8 come in |
use warnings; | |
use strict; | |
use Mail::SendGrid; | |
use Mail::SendGrid::Transport::SMTP; | |
my $sg = Mail::SendGrid->new( from => '[email protected]', | |
to => '[email protected]', | |
subject => 'Testing', | |
text => "Some text http://sendgrid.com/\n", |
<?xml version="1.0" encoding="UTF-8" ?> | |
<feedback> | |
<report_metadata> | |
<org_name>receiver.com</org_name> | |
<email>[email protected]</email> | |
<extra_contact_info>http://receiver.com/dmarc/support</extra_contact_info> | |
<report_id>9391651994964116463</report_id> | |
<date_range> | |
<begin>1335571200</begin> | |
<end>1335657599</end> |