Git Product home page Git Product logo

umail's Introduction

µMail (MicroMail)

A lightweight, scalable SMTP client for sending email in MicroPython.

Usage:

A bare minimal approach

import umail
smtp = umail.SMTP('smtp.gmail.com', 587, username='[email protected]', password='mypassword')
smtp.to('[email protected]')
smtp.send("This is an example.")
smtp.quit()

API docs:

  • umail.SMTP(host, port, [ssl, username, password])

    • host - smtp server
    • port - server's port number
    • ssl - set True when SSL is required by the server
    • username - my username/email to the server
    • password - my password
  • SMTP.login(username, password) If you did not login when intializing the server, do it here!

  • SMTP.to(addrs, mail_from)

    • addrs - Recipient's email address. If multiple recipents, use a list, eg. ['[email protected]', '[email protected]']
    • mail_from - manually specify the MAIL FROM address, default value is your smtp username. example
  • SMTP.write(content) To send a long email or an email that contains large attachments, you will most likely exceed the memory limit of your MCU.
    Use this function to break up your email into smaller chunks.
    Each call to write() will cause the current content to be sent to the server so you can load the next chunk.

  • SMTP.send([content]) Finish writing the email.
    Make the SMTP server to actually send your email to the recipent address.

  • SMTP.quit() Close the connection to the server

Other

For more details, pleasse refer to sample code under examples\

umail's People

Contributors

shawwwn avatar mtowara avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.