Mailgun

Email Service For Developers


Examples

curl

curl -s --user 'api:key-3ax6xnjp29jd6fds4gc373sgvjxteol0' \
    https://api.mailgun.net/v3/samples.mailgun.org/messages \
    -F from='Excited User <[email protected]>' \
    -F to='[email protected]' \
    -F subject='Hello' \
    -F text='Testing some Mailgun awesomeness!'

Ruby

def send_simple_message
  RestClient.post "https://api:key-3ax6xnjp29jd6fds4gc373sgvjxteol0"\
  "@api.mailgun.net/v3/samples.mailgun.org/messages",
  :from => "Excited User <[email protected]>",
  :to => "[email protected]",
  :subject => "Hello",
  :text => "Testing some Mailgun awesomeness!"
end

PHP

# Include the Autoloader (see "Libraries" for install instructions)
require 'vendor/autoload.php';
use Mailgun\Mailgun;

# Instantiate the client.
$mgClient = new Mailgun('key-3ax6xnjp29jd6fds4gc373sgvjxteol0');
$domain = "samples.mailgun.org";

# Make the call to the client.
$result = $mgClient->sendMessage("$domain",
  array('from'    => 'Excited User <[email protected]>',
        'to'      => 'Mailgun Devs <[email protected]>',
        'subject' => 'Hello',
        'text'    => 'Testing some Mailgun awesomeness!'));

References

results matching ""

    No results matching ""