Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IMAPLIB
#1
Hello everyone,
I'm new to python, so any help would be much appreciated.
My project is to create a script that logs in to a Gmail account and provide the
Following details:
10 latest emails from a specific sender
Email's subject
Email's Date & Time
I succeed creating a code sample that logs in to a gmail account>inbox>all mail list:

import email
import imaplib
import datetime
import email.header


username = '[email protected]'
password = 'password'

mail = imaplib.IMAP4_SSL("imap.gmail.com")
mail.login(username, password)

mail.select("inbox")

result, data = mail.uid('search', None, "ALL")

inbox_item_list= data[0].split()

inbox_item_list
I know a lot of stuff is missing or incorrect but thats what I'm getting from
My starting position.
Any corrections & additions would be very helpful.
Thank you
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  imaplib.error : login FAILED FanTom 3 17,358 Aug-21-2019, 08:57 AM
Last Post: rahul_ashtikar

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020