#!/usr/bin/perl -w use strict; use Mail::Sendmail; #put your smtp server instead of localhost in the next line unshift @{$Mail::Sendmail::mailcfg{'smtp'}} , 'localhost'; my $initial = "qwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnm"; while(length $initial){ # while line is not empty my $msg = substr $initial, 0, 100, ""; # chop 100 chars my %mail = ( "To" => 'abstract@mirage', # the address you want to send to "From" => 'abstract@mirage', # your email address "Subject" => 'This is a test message!', # the subject "Message" => $msg); # attempt to send the message sendmail(%mail) or die "Error sending email: $Mail::Sendmail::error\n"; }