<commit_before>.. code-block:: bash

    curl -s --user 'api:YOUR_API_KEY' \
	https://api.mailgun.net/v3/YOUR_DOMAIN_NAME/messages \
	-F from='Excited User <mail<EMAIL>@YOUR_DOMAIN_NAME>' \
	-F to=YOU@YOUR_DOMAIN_NAME \
	-F to=<EMAIL> \
	-F subject='Hello' \
	-F text='Testing some Mailgun awesomness!'

.. code-block:: java

 import java.io.File;

 import com.mashape.unirest.http.HttpResponse;
 import com.mashape.unirest.http.JsonNode;
 import com.mashape.unirest.http.Unirest;
 import com.mashape.unirest.http.exceptions.UnirestException;


 public class MGSample {

     // ...

     public static JsonNode sendSimpleMessage() throws UnirestException {

         HttpResponse<JsonNode> request = Unirest.post("https://api.mailgun.net/v3/" + YOUR_DOMAIN_NAME + "/messages")
			 .basicAuth("api", API_KEY)
		     .queryString("from", "Excited User <<EMAIL>>")
		     .queryString("to", "<EMAIL>")
		     .queryString("subject", "hello")
		     .queryString("text", "testing")
		     .asJson();

	    return request.getBody();
     }
 }

.. code-block:: php

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

  # Instantiate the client.
  $mgClient = new Mailgun('YOUR_API_KEY');
  $domain = "YOUR_DOMAIN_NAME";

  # Make the call to the client.
  $result = $mgClient->sendMessage($domain, array(
      'from'    => 'Excited User <mailgun@YOUR_DOMAIN_NAME>',
      'to'      => 'Baz <YOU@YOUR_DOMAIN_NAME>',
      'subject' => 'Hello',
      'text'    => 'Testing some Mailgun awesomness!'
  ));

.. code-block:: py

 def send_simple_message():
     return requests.post(
         "https://api.mailgun.net/v3/YOUR_DOMAIN_NAME/messages",
         auth=("api", "YOUR_API_KEY"),
         data={"from": "Excited User <<EMAIL>>",
               "to": ["<EMAIL>", "YOU@YOUR_DOMAIN_NAME"],
               "subject": "Hello",
               "text": "Testing some Mailgun awesomness!"})

.. code-block:: rb

 def send_simple_message
   RestClient.post "https://api:YOUR_API_KEY"\
   "@api.mailgun.net/v3/YOUR_DOMAIN_NAME/messages",
   :from => "Excited User <<EMAIL>>",
   :to => "<EMAIL>, YOU@YOUR_DOMAIN_NAME",
   :subject => "Hello",
   :text => "Testing some Mailgun awesomness!"
 end

.. code-block:: csharp

 using System;
 using System.IO;
 using RestSharp;
 using RestSharp.Authenticators;<commit_msg>Updated the PHP send example. Fixes issue #274<commit_after>.. code-block:: bash

    curl -s --user 'api:YOUR_API_KEY' \
	https://api.mailgun.net/v3/YOUR_DOMAIN_NAME/messages \
	-F from='Excited User <<EMAIL>>' \
	-F to=YOU@YOUR_DOMAIN_NAME \
	-F to=<EMAIL> \
	-F subject='Hello' \
	-F text='Testing some Mailgun awesomness!'

.. code-block:: java

 import java.io.File;

 import com.mashape.unirest.http.HttpResponse;
 import com.mashape.unirest.http.JsonNode;
 import com.mashape.unirest.http.Unirest;
 import com.mashape.unirest.http.exceptions.UnirestException;


 public class MGSample {

     // ...

     public static JsonNode sendSimpleMessage() throws UnirestException {

         HttpResponse<JsonNode> request = Unirest.post("https://api.mailgun.net/v3/" + YOUR_DOMAIN_NAME + "/messages")
			 .basicAuth("api", API_KEY)
		     .queryString("from", "Excited User <<EMAIL>>")
		     .queryString("to", "<EMAIL>")
		     .queryString("subject", "hello")
		     .queryString("text", "testing")
		     .asJson();

	    return request.getBody();
     }
 }

.. code-block:: php

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

  # First, instantiate the SDK with your API credentials
  $mg = Mailgun::create('YOUR_API_KEY');

  # Now, compose and send your message.
  # $mg->messages()->send($domain, $params);
  $mg->messages()->send('YOUR_DOMAIN_NAME', [
    'from'    => 'Excited User <mailgun@YOUR_DOMAIN_NAME>',
    'to'      => 'Baz <YOU@YOUR_DOMAIN_NAME>',
    'subject' => 'Hello',
    'text'    => 'Testing some Mailgun awesomness!'
  ]);

.. code-block:: py

 def send_simple_message():
     return requests.post(
         "https://api.mailgun.net/v3/YOUR_DOMAIN_NAME/messages",
         auth=("api", "YOUR_API_KEY"),
         data={"from": "Excited User <mailgun@YOUR_DOMAIN_NAME>",
               "to": ["<EMAIL>", "YOU@YOUR_DOMAIN_NAME"],
               "subject": "Hello",
               "text": "Testing some Mailgun awesomness!"})

.. code-block:: rb

 def send_simple_message
   RestClient.post "https://api:YOUR_API_KEY"\
   "@api.mailgun.net/v3/YOUR_DOMAIN_NAME/messages",
   :from => "Excited User <<EMAIL>>",
   :to => "<EMAIL>, YOU@YOUR_DOMAIN_NAME",
   :subject => "Hello",
   :text => "Testing some Mailgun awesomness!"
 end

.. code-block:: csharp

 using System;
 using System.IO;
 using RestSharp;
 using RestSharp.Authenticators;
{'fraction_non_alphanumeric': 0.1603401783862269, 'fraction_numerical': 0.0022816842978635138, 'mean_word_length': 3.2786157941437444, 'pattern_counts': {'":': 8, '<': 32, '<?xml version=': 0, '>': 53, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2350789', 'n_tokens_mistral': 1794, 'n_tokens_neox': 1687, 'n_words': 336}