Last active
July 14, 2020 10:39
-
-
Save jekayode/44a00f2cfcc8e8dc0c2fbb12e21f506e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| require 'vendor/autoload.php'; | |
| use Mailgun\Mailgun; | |
| // First, instantiate the SDK with your API credentials | |
| $mg = Mailgun::create('my-domain-apikey'); // For US servers | |
| //$mg = Mailgun::create(‘my-apikey, 'https://api.eu.mailgun.net'); // For EU servers | |
| $name = "Emmanuel"; | |
| $email = "emmanuel@email.com"; | |
| $message = "Thank you for a job well done"; | |
| $reslt = $mg->messages()->send('my-mailgun-domain', [ | |
| 'from'=> $email, | |
| 'to'=> 'support@company.com', | |
| 'subject' => 'Testimonial Email, | |
| 'html' => $message, | |
| ]); | |
| //var_dump($result); | |
| $response = $result->getMessage(); // Grab success message | |
| echo $response; | |
| ?> | |
| Note: Remember to first run `require mailgun/mailgun-php` in your project root |
Author
Author
Added composer command instruction
Author
Typo correction
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Initial commit