Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 28 lines (21 sloc) 0.535 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
use strict;
use warnings;
use Net::SMTP;

my $rcpts = $ARGV[0] || 1;

my $smtp = Net::SMTP->new(
  'playground',
  Port => 25,
  Debug => 1,
);

CMD: {
  last CMD unless $smtp->mail('sender@example.com');

  for (1 .. $rcpts) {
    last CMD unless $smtp->to("recipient+$_\@example.com");
  }

  last CMD unless $smtp->data;
  last CMD unless $smtp->datasend("Message-Id: <$$-$^T\@example.com>\n");
  last CMD unless $smtp->datasend("\n");
  last CMD unless $smtp->datasend("Body\n");
  last CMD unless $smtp->dataend;
}

$smtp->quit;
Something went wrong with that request. Please try again.