Skip to content

Instantly share code, notes, and snippets.

@kizashi1122
Created August 28, 2019 04:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kizashi1122/ed9323918acd77d0f225e486ca469f60 to your computer and use it in GitHub Desktop.
Save kizashi1122/ed9323918acd77d0f225e486ca469f60 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use v5.28;
use utf8;
use Net::POP3;
use Net::POP3::XOAuth2;
my $user = 'myaccount@example.com';
my $token = 'ya29.GltdBxoUGp4......'; # retrieve with OAuth2
my $pop = Net::POP3->new('pop.gmail.com', Port => 995, Timeout => 30, SSL => 1, Debug => 1);
$pop->xoauth2($user, $token);
$pop->quit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment