Skip to content

Instantly share code, notes, and snippets.

@MrCl0wnLab
Created April 16, 2020 01:23
Show Gist options
  • Save MrCl0wnLab/9e4cffb881a80ee06d3fd23c39a38ccb to your computer and use it in GitHub Desktop.
Save MrCl0wnLab/9e4cffb881a80ee06d3fd23c39a38ccb to your computer and use it in GitHub Desktop.
Exemplo de uso Class PHP criada para envio simples de email via API Mailgun
<?php
require_once('SenderMailgun.php');
# Open file key
$key = file_get_contents('key');
# Instantiate the client.
SenderMailgun::$api_key = $key;
# Data params email.
$params = [
'from'=> 'Your Name <you@maketing.your.ecommerce.br>',
'to'=>'your-client@gmail.com',
'subject'=>'Your subject',
'html'=>'<h1>Black Friday!!!</h1>'
];
# Action sender.
SenderMailgun::send_mail('marketing.imaginarionerd.com.br',$params);
print_r(SenderMailgun::$result_send);
exit();
@MrCl0wnLab
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment