PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, October 23, 2022

[FIXED] How to read email using python and smtplib

 October 23, 2022     email, python, smtp, smtplib, yandex     No comments   

Issue

Found a lot of examples how to send mail, but how can I read inbox? For example yandex.

import smtplib as smtp

email = "me@example.com"
password = "password"

server = smtp.SMTP_SSL('smtp.yandex.com')
server.set_debuglevel(1)
server.ehlo(email)
server.login(email, password)
server.auth_plain()
# server.get_and_print_your_inbox_magic_method()
server.quit()

Solution

The SMTP protocol is for sending mails. If you want to look at your inbox - aka receive mails - you need to use POP3 or IMAP.

But just like smtplib, Python also has imaplib for IMAP and poplib for POP3.



Answered By - finefoot
Answer Checked By - Cary Denson (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing