Q: Perl script is not sending email I am trying to send my first email (from a windows machine) with Perl, but I am getting an error:
SMTP Failed to connect to mail server: at emailer2.pl line 18 (msg->send;)

I am totally new to Perl so any help would be greatly appreciated.  Has anyone encountered this problem before?  I have searched for the error but I had no luck finding my exact problem.
Thanks so much for your help!
CODE:
#!/usr/bin/perl
use MIME::Lite;

$to = 'myemail@gmail.com';
$cc = 'myemail@gmail.com';
$from = 'myemail@gmail.com';
$subject = 'Test Email';
$message = 'This is test email sent by Perl Script';

$msg = MIME::Lite->new(
                 From     => $from,
                 To       => $to,
                 Cc       => $cc,
                 Subject  => $subject,
                 Data     => $message
                 );

$msg->send;
print "Email Sent Successfully\n";


A: It means you don't have a mail server running on your machine. You need to install one and make sure it is running.

A: You may also use another mail server setting default parameters before sending the message
MIME::Lite->send('smtp', "smpt.example.org", Timeout=>60, SSL=>1,
                 AuthUser=>"myself", AuthPass=>"mysecret");

Take a look at MIME::Lite sending section.
