PERL Email::Send::Gmail Cannot connect to Gmail account on Windows 7

前端 未结 2 1329
走了就别回头了
走了就别回头了 2021-01-06 07:25

I am trying to use Email::Send::Gmail to send an email, but for some reason I am getting an error that it is not allowing me to connect.

The code is the standard exa

2条回答
  •  时光说笑
    2021-01-06 07:44

    Just Upgrade your active Perl version.

    Then Install following modules: ppm

    1. install Email::send:Gmail
    2. install Net::SMTP:SSL
    3. installIO::socket::SSL

    Then try with below sample code.

     #!/home/ben/software/install/bin/perl
            use warnings;
            use strict;
            use Email::Send;
        use Email::Send::Gmail;
        use Email::Simple::Creator;
    
        my $email = Email::Simple->create (
            header => [
                From    => '@gmail.com',
                    To      => '@gmail.com',
                    Subject => 'Make it simple',
            ],
    
            body => 'buddy I got it ...',
        );
    
        my $sender = Email::Send->new 
        ({
                mailer      => 'Gmail',
                mailer_args => 
    [
                    username => '',
                    password => '',
            ]
        });
    
        $sender->send ($email);
    

提交回复
热议问题