Last active
November 28, 2019 05:53
-
-
Save ak64th/683770a64eface0ccdbd6da8759d16cb to your computer and use it in GitHub Desktop.
Use imaplib with socks proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install PySocks first: pip install PySocks | |
import socket | |
import socks | |
import imaplib | |
socks.set_default_proxy(socks.SOCKS5, "localhost") | |
socket.socket = socks.socksocket | |
m = imaplib.IMAP4_SSL("imap.gmail.com") | |
m.login('[email protected]','google_app_password') | |
# ('OK', [b'[email protected] authenticated (Success)']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment