php composer mailgun
// First, instantiate the SDK with your API credentials $mg = Mailgun::create('key-example'); // For US servers $mg = Mailgun::create('key-example', 'https://api.eu.mailgun.net'); // For EU servers // Now, compose and send your message. // $mg->messages()->send($domain, $params); $mg->messages()->send('example.com', [ 'from' => 'bob@example.com', 'to' => 'sally@example.com', 'subject' => 'The PHP SDK is awesome!', 'text' => 'It is so simple to send a message.' ]);
Source: github.com