Perl

  1. use strict;

  2. use warnings;

  3. use LWP::UserAgent;

  4. my $from ='example@pepipost.com';

  5. my $fromname ="YourName";

  6. my $to ='abc@pepipost.com';

  7. my $api_key ="YourApiKey";

  8. my $subject ="Test Mail";

  9. my $content ="This is my Mail Content";

  10. my $browser = LWP::UserAgent->new;

  11. my $response = $browser->post("http://api.pepipost.com/api/web.send.rest",

  12. [

  13. 'api_key'=> $api_key,

  14. 'fromname'=> $fromname,

  15. 'from'=> $from,

  16. 'content'=> $content,

  17. 'subject'=> $subject,

  18. 'recipients'=> $to

  19. ],

  20. );

  21. if($response->status_line =~/200/){

  22. print"Successful";}else{

  23. print"Error";

  24. }