Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Sending SMTP Email

    Scheduled Pinned Locked Moved Comments & Feedback
    lopywipy3.0gpyconnectsmtp
    6 Posts 5 Posters 1.1k Views 6 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G Offline
      guyc
      last edited by

      Is there a straight forward micro python script or lib for sending email on Gpy, or Wipy, or Lopy?

      We currently use the following code with Python 3 smtplib on RaspberryPi;

          server = smtplib.SMTP('mailserver',port,'',5)
          print ('Connected to the smtp server, trying to log on...')
          server.ehlo(host)
          print ('Sent ehlo')
          server.login(smtp_user, smtp_password)
          print ('Logged onto smtp server, trying to send email...')
          server.sendmail(fromaddr, recipients, message)
          server.close()
      
      J 1 Reply Last reply Reply Quote 0
      • J Offline
        jcaron @guyc
        last edited by

        @guyc usually, one would rather do it from a server, and trigger that from the device using a webservice or the network-specific equivalent (you won’t be doing SMTP over LoRaWAN...).

        But if you absolutely want to do it (I would recommend doing so only if you have WiFi avalaible), what issue are you having with smtplib? Are you getting an error? If so, which?

        1 Reply Last reply Reply Quote 0
        • G Offline
          guyc
          last edited by

          We have a number of modules (Gpy, Wipy, and Lopy) all of which we are using WiFi. We need to send an email on an event (GPIO going hi or lo as an example). For Micro Python we cannot find any smtp libraries. We see a dummy smtplib but we cannot find any functional smtplib for Micro Python that can run on Gpy, Wipy, or Lopy.

          Are there any such libraries like Python 3 version of smtplib to send email via WiFi for Micro Python?

          1 Reply Last reply Reply Quote 0
          • L Offline
            loboris
            last edited by

            I have email send method implemented in my MycroPython port as a part of the curl module.
            I think it could be easily ported to Pycom's MicroPython (curl_mail.c, modcurl.c)...

            1 Reply Last reply Reply Quote 1
            • M Offline
              MarkFord Banned
              last edited by

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • E Offline
                Emmanuel Florent
                last edited by

                This post is deleted!
                1 Reply Last reply Reply Quote 0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                • 1 / 1
                • First post
                  Last post

                Pycom on Twitter

                Pycom