Question: How can I send mail to Gmail using Perl? Here's what I'm trying:

```
my $mailer = Email::Send->new(
    {
        mailer      => 'SMTP::TLS',
        mailer_args => [
            Host     => 'smtp.gmail.com',
            Port     => 587,
            User     => 'xxx',
            Password => 'xxx',
        ]
    }
);

use Email::Simple::Creator;    # or other Email::

use File::Slurp;
@arrIrc = read_file("$ircFile");
my $email = Email::Simple->create(
    header => [
        From    => 'xxx',
        To      => "$configList{email}",
        Subject => "The summary of logfile $channelName",
    ],
    body => "@arrIrc",
);

```

Answer: 
Use [Net::SMTP::SSL](http://search.cpan.org/perldoc/Net::SMTP::SSL) to talk to GMail.

See [MIME::Lite inline images](http://www.perlmonks.org/?node_id=784574) on [Perlmonks](http://www.perlmonks.org) for an example.
If you want to send mail to Gmail, you do the same thing you would do to send mail anywhere. If you want to send mail through Gmail, there is the [Email::Send::Gmail](http://search.cpan.org/dist/Email-Send-Gmail/) module. Merely typing your question in Google led me to [Sending Mail Through Gmail with Perl](http://www.nixtutor.com/linux/sending-mail-through-gmail-with-perl/) by Mark Sanborn.