1// First, instantiate the SDK with your API credentials
2$mg = Mailgun::create('key-example'); // For US servers
3$mg = Mailgun::create('key-example', 'https://api.eu.mailgun.net'); // For EU servers
4
5// Now, compose and send your message.
6// $mg->messages()->send($domain, $params);
7$mg->messages()->send('example.com', [
8 'from' => 'bob@example.com',
9 'to' => 'sally@example.com',
10 'subject' => 'The PHP SDK is awesome!',
11 'text' => 'It is so simple to send a message.'
12]);