Guest User

Untitled

a guest
Apr 18th, 2016
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. <?php
  2. # Include the Autoloader (see "Libraries" for install instructions)
  3. require 'vendor/autoload.php';
  4. use Mailgun\Mailgun;
  5.  
  6. # Instantiate the client.
  7. $mgClient = new Mailgun('key-5de7dbedc4569f05a359318ae2b38bc6');
  8. $domain = "sandbox91af2a08b4794186860486d1deeffbb2.mailgun.org";
  9.  
  10.  
  11. # Make the call to the client.
  12. $result = $mgClient->sendMessage($domain, array(
  13. 'from' => 'Naresh Testing <postmaster@sandbox91af2a08b4794186860486d1deeffbb2.mailgun.org>',
  14. 'to' => 'bhupinder@staplelogic.in, naresh@staplelogic.in, bhupinder.bisht22@gmail.com, bhupinder.staplelogic@gmail.com, bhupinder.bisht87@gmail.com',
  15. 'subject' => 'Hey %recipient.first%',
  16. 'h:Reply-To' => "bhupinder@staplelogic.in, naresh@staplelogic.in, bhupinder.bisht22@gmail.com, bhupinder.staplelogic@gmail.com, bhupinder.bisht87@gmail.com" ,
  17.  
  18. 'html' => '<p>Welcome to Batching R&D on 14 April!.<a href="http://www.myconversionbrain.com">myconversionbrain.com</a> </p>',
  19.  
  20. 'recipient-variables' => '{"bhupinder@staplelogic.in": {"first":"Bhupinder", "id":1},
  21. "naresh@staplelogic.in": {"first":"naresh", "id": 2},
  22. "bhupinder.bisht22@gmail.com": {"first":"bhgmail", "id": 3},
  23. "bhupinder.staplelogic@gmail.com": {"first":"bhupinstaplelogic", "id": 4},
  24. "bhupinder.bisht87@gmail.com": {"first":"bhupin87", "id": 5}
  25.  
  26.  
  27. }',
  28.  
  29.  
  30.  
  31. ));
  32.  
  33. echo "<pre>";
  34. print_r($result);
  35. echo "</pre>";
  36. if(!$result) {
  37. echo 'Message could not be sent.';
  38. // echo 'Mailer Error: ' . $mail->ErrorInfo;
  39. } else {
  40. echo 'Message has been sent';
  41. }
  42.  
  43.  
  44. ?>
Add Comment
Please, Sign In to add comment