How to Send Email using Mailgun PHP API
1. Create an account at Mailgun.com , you would get API Key and a sandbox domain for testing. You shall later add your custom domain too. 2. Create a sample project folder and install Composer. mailguntest is out project name, you can change as per your requirement. >mkdir mailguntest >cd mailguntest >curl -sS https://getcomposer.org/installer | php Once Composer is installed, add Mailgun PHP API / library too. >php composer.phar require mailgun/mailgun-php:~1.7.1 I have used version 1.7.1, you can use any. see https://packagist.org/packages/mailgun/mailgun-php for details. 3. In mailguntest folder, create mailer.php file with below contents: Update the code as per your mailgun code settings: <?php require 'vendor/autoload.php'; use Mailgun\Mailgun; $mg = new Mailgun("write your API key here"); $domain = "write-your-sandbox-domain for testing"; $mg->sendMessage($domain, array( 'from' => 'postmaster@write-your-sa...