2

Is it possible to wifi enable the Raspberry Pi so that it could receive emails? They are just photos automatically sent from my photo account, so there is no text. Then it needs to automatically send the images from the email over Bluetooth to a device that can print it out. (polaroid gl10)?

The aim is to:

  1. Receive email
  2. Send newest file/email to Bluetooth printer device
  3. Print photo
  4. Delete that email
  5. Wait for another email/start process again from 1
Piotr Kula
  • 17,336
  • 6
  • 66
  • 105
nico_m
  • 21
  • 1
  • 2

1 Answers1

2

You can just use the Python imaplib. Here as an example of connecting to gmail (you need to enable imap in the gmail control panel)

import getpass, imaplib

M = imaplib.IMAP4_SSL('imap.gmail.com', 993)
M.login(getpass.getuser(), getpass.getpass())
M.select()
typ, data = M.search(None, 'ALL')
for num in data[0].split():
    typ, data = M.fetch(num, '(RFC822)')
    print 'Message %s\n%s\n' % (num, data[0][1])
M.close()
M.logout()
John La Rooy
  • 12,005
  • 9
  • 48
  • 77