Below code works as well as getting the attachment through.
I also had to change my gmail account settings to allow access for less
secure apps.
use strict;
use warnings;
use Email::Send::SMTP::Gmail;
my ($mail,$error) = Email::Send::SMTP::Gmail->new(
-layer =>'ssl',
-port =>'465',
-smtp =>'smtp.gmail.com',
-login =>'myemail@gmail.com',
-pass =>'mypassword'
);
die "session error: $error" if $mail ==-1;
<>
$mail->send(
-to =>'myemail@gmail.com',
-subject =>'Hello!',
-body =>'Just testing it',
-attachments=>'C:\Users\MyName\Documents\My_IT_Resume.doc'
);
$mail->bye;
On Fri, Apr 26, 2019 at 2:15 AM Juan Jose San Martin via RT <
bug-Email-Send-SMTP-Gmail@rt.cpan.org> wrote:
Show quoted text> <URL:
https://rt.cpan.org/Ticket/Display.html?id=129313 >
>
> Hello,
>
> Please, add the verbose and debug options to see the issue.
>
> my $email=Email::Send::SMTP::Gmail->new(-debug=>1,verbose=>1,
> -smtp=>'smtp.gmail.com',
> -login=>'XXXXX@gmail.com',
> -pass=>'XXXXXX');
>
> It seems your Gmail account is blocked for standard SMTP connections.
>
> Regards,
> Peco
>
> On Thu Apr 25 17:46:04 2019, erichansen1836@gmail.com wrote:
> > use strict;
> > use warnings;
> > use Email::Send::SMTP::Gmail;
> >
> > my $mail=Email::Send::SMTP::Gmail->new( -smtp=>'smtp.gmail.com',
> > -login=>'XXXXX@gmail.com',
> > -pass=>'XXXXXX');
> >
> > $mail->send(-to=>'XXXXX@gmail.com', -subject=>'This file is for you',
> > -body=>'Just a quick note to send with a file.');
> >
> > $mail->bye;
> >
> > [image: image.png]
>
>
>
>