TÀI KHOẢN OUTLOOK | 1 THÁNG TUỔI | ĐĂNG NHẬP WEB | TOKEN OAUTH2 | ĐÃ BẬT POP3, IMAP

TÀI KHOẢN OUTLOOK | 1 THÁNG TUỔI | ĐĂNG NHẬP WEB | TOKEN OAUTH2 | ĐÃ BẬT POP3, IMAP

4h

Còn 81298

27.757 ₫
  • Tài khoản Outlook chất lượng cao.
  • Tuổi 1 THÁNG.
  • Đăng nhập web được.
  • Sống rất lâu, có thể tới một năm hoặc hơn.
  • Tài khoản mới, chưa dùng ở đâu, chỉ bạn có quyền truy cập.
  • Đã kích hoạt OAuth2, kèm RefreshToken, ClientId.
  • Đã bật POP3, IMAP. Dùng OAuth2 để truy cập IMAP, POP3.
  • Nam hoặc nữ.

Định dạng tài khoản: login:password:refresh_token:client_id

Quan trọng: Nếu khi đăng nhập bằng trình duyệt bạn được yêu cầu thêm email khôi phục, chỉ cần mở:

https://outlook.live.com/mail/0/

Bạn sẽ vào thẳng hộp thư vì đã đăng nhập. Chỉ cần mở link trong cùng trình duyệt.

  • Tài khoản Outlook chất lượng cao.
  • Tuổi 1 THÁNG.
  • Đăng nhập web được.
  • Sống rất lâu, có thể tới một năm hoặc hơn.
  • Tài khoản mới, chưa dùng ở đâu, chỉ bạn có quyền truy cập.
  • Đã kích hoạt OAuth2, kèm RefreshToken, ClientId.
  • Đã bật POP3, IMAP. Dùng OAuth2 để truy cập IMAP, POP3.
  • Nam hoặc nữ.

Định dạng tài khoản giao: login:password:refresh_token:client_id

Quan trọng: Nếu khi đăng nhập tài khoản bằng trình duyệt bạn được yêu cầu thêm email dự phòng, chỉ cần mở link:

https://outlook.live.com/mail/0/

Bạn sẽ vào thẳng hộp thư vì đã đăng nhập tài khoản. Chỉ cần mở link này trong cùng trình duyệt.


Ví dụ Python đọc email qua OAuth2 IMAP:

import base64
import imaplib
import poplib
import requests

def get_access_token(client_id, refresh_token):
data = {
'client_id': client_id,
'grant_type': 'refresh_token',
'refresh_token': refresh_token
}
ret = requests.post('https://login.live.com/oauth20_token.srf', data=data)

# Print the response content and access token
print(ret.text)
print(ret.json()['access_token'])
return ret.json()['access_token']

# Generate OAuth2 authentication string using the access token
def generate_auth_string(user, token):
auth_string = f"user={user}\1auth=Bearer {token}\1\1"
return auth_string

pop3_server = 'outlook.office365.com'
pop3_port = 995 # POP3 over SSL

def connect_pop3(email, access_token):
server = poplib.POP3_SSL(pop3_server, pop3_port)
# Authenticate using OAuth2
auth_string = generate_auth_string(email, access_token)
encoded_auth_string = base64.b64encode(auth_string.encode("utf-8")).decode("utf-8")
server._shortcmd(f'AUTH XOAUTH2')
server._shortcmd(f'{encoded_auth_string}')

# Retrieve the list of emails
num_messages = len(server.list()[1])
print(f"There are {num_messages} emails in the inbox.")

# Retrieve email content
for i in range(num_messages):
response, lines, octets = server.retr(i + 1)
msg_content = b"\n".join(lines).decode("utf-8")
print(f"Email {i + 1}:")
print(msg_content)
print("=" * 50)

def connect_imap(email, access_token):
mail = imaplib.IMAP4_SSL('outlook.office365.com')
# Print the generated authentication string
print(generate_auth_string(email, access_token))
mail.authenticate('XOAUTH2', lambda x: generate_auth_string(email, access_token))
mail.select("INBOX")
status, messages = mail.search(None, 'ALL')
print("Email IDs:", messages)
mail.logout()

# Set the email address and refresh token
client_id = 'CLIENT_ID_HERE'
email = "example@hotmail.com"
t = "YOUR_REFRESH_TOKEN_HERE"

# Get the access token using the refresh token
acc_token = get_access_token(client_id, t)

# Connect to the IMAP server and access emails
connect_imap(email, acc_token)

Sản phẩm đề xuất

TÀI KHOẢN OUTLOOK | 1 THÁNG TUỔI | ĐĂNG NHẬP WEB | TOKEN OAUTH2 | ĐÃ BẬT POP3, IMAP