use strict; use warnings; use Email::Send::SMTP::Gmail; my $mail=Email::Send::SMTP::Gmail->new( -smtp=>'smtp.gmail.com', -login=>'myid', -pass=>'mypasswrd'); $mail->send(-to=>'sendtoid', -subject=>'Hello!', -body=>'Just testing it', -attachments=>'C:/strawberry/perl/test.txt'); $mail->bye;