Receive email | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Receive email

How would i receive an email with no attachments and no subject to python as a string?

20th Jan 2019, 4:52 PM
Imagine Existance
Imagine Existance - avatar
30 Answers
+ 1
@Tolo, thank you for helping but it keeps on giving an EOF error on a line that doesent exist
20th Jan 2019, 7:38 PM
Imagine Existance
Imagine Existance - avatar
+ 1
When I copied it from my PC I lost the last 3 lines of code. That caused the error but I fixed it
20th Jan 2019, 8:00 PM
Tolo
Tolo - avatar
+ 1
thank you
20th Jan 2019, 10:09 PM
Imagine Existance
Imagine Existance - avatar
+ 1
for it to work i had to modify the b”{}”.format part to just b”10”
20th Jan 2019, 10:23 PM
Imagine Existance
Imagine Existance - avatar
0
Did you try something like that? https://code.sololearn.com/cNR6O6dPjJTZ/?ref=app
20th Jan 2019, 5:40 PM
Tolo
Tolo - avatar
0
it is not printing even though the message in the inbox had nothing besides a couple of words i removed the try and it gave an error for nullset where data was
20th Jan 2019, 8:22 PM
Imagine Existance
Imagine Existance - avatar
0
Try to check if your inbox is named INBOX and if there are any mails con.list() gives you all you folders you can select
20th Jan 2019, 9:28 PM
Tolo
Tolo - avatar
0
ok
20th Jan 2019, 9:48 PM
Imagine Existance
Imagine Existance - avatar
0
it doesent work on my end, can you test it with your account and tell me what might be wrong im using imap.gmail.com for the url
20th Jan 2019, 9:55 PM
Imagine Existance
Imagine Existance - avatar
0
For googlemail you need to change some settings so you can use a custom mail program as your python script
20th Jan 2019, 10:04 PM
Tolo
Tolo - avatar
0
wait, so it cant run with gmail? what can i change, i am making a gmail texting program that sends a message to gmail to a sms account like @vtex.com it sends the message back to the gmail account
20th Jan 2019, 10:07 PM
Imagine Existance
Imagine Existance - avatar
0
You can but you have to set some settings before I am seraching for those
20th Jan 2019, 10:08 PM
Tolo
Tolo - avatar
0
You have to turn less secure apps on
20th Jan 2019, 10:14 PM
Tolo
Tolo - avatar
0
did that i had to do it for the smtplib sending part
20th Jan 2019, 10:14 PM
Imagine Existance
Imagine Existance - avatar
0
and it doesn't work?
20th Jan 2019, 10:15 PM
Tolo
Tolo - avatar
0
no
20th Jan 2019, 10:15 PM
Imagine Existance
Imagine Existance - avatar
0
i use my gmail account and password and the url imap.gmail.com
20th Jan 2019, 10:16 PM
Imagine Existance
Imagine Existance - avatar
0
what value has your mailpos and how many mails are in your inbox?
20th Jan 2019, 10:17 PM
Tolo
Tolo - avatar
0
0 but i cant find anything it relates to
20th Jan 2019, 10:19 PM
Imagine Existance
Imagine Existance - avatar
0
con.select(folder)[1] should give you the number of emails in that folder
20th Jan 2019, 10:20 PM
Tolo
Tolo - avatar