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

    wipy 1.0 sending email

    Scheduled Pinned Locked Moved Getting Started
    email smtp wipy
    1 Posts 1 Posters 541 Views 1 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.
    • M Offline
      marty
      last edited by

      Hi All

      This question has been asked before, but the solutions given in this forum don't appear to be working for me. I am trying to send an email from my wipy 1.0 using gmail smtp and I attempt to implement the solution on page 2 of this topic: https://forum.micropython.org/viewtopic.php?f=11&t=1047&start=10

      I have downloaded the stripped down smtplib and attempt to use the accompanying code in the topic linked above.

      When I run this on my laptop using port=465 and Tls = True, I can send an email. This surprised me somewhat because according to gmail's website (https://support.google.com/a/answer/176600?hl=en) one should connect to port 587 when using tls!!! Anyway....

      When I upload the code onto the wipy and attempt to execute [port = 465, Tls = True] the code fails at the call to SMTP->get reply with the message SMTPServerDisconnected: Connection Unexpectedly Closed

      I'm suprised I'm getting a different behaviour depending on whether I run the code on my laptop or on the wipy. I wondered if gmail is able to block certain IPs... but I can't see anyway of managing this in my gmail account.

      On my wipy, I also try running the code with port=587, Tls = True (to better reflect the advice on gmails website). The code manages to execute SMTP and helo but fails at login. I get the message SMTPAuthentificationError: (530, b'5.7.0 Must issue a STARTTLS command first.... {I noted that in the topic linked above specific mention was made of not needing to call starttls, it also states that when using Tls one should use port 465 which I am struggling to reconcile with gmail's advice to use port 587 when using tls)

      I tried calling smtpserver.starttls() after helo and before login.... then I get SMTPAuthentificationError: (-1, b'\x02\x02F')

      Any thoughts? I'm new to all of this and naively assumed that sending emails from an IoT board would be essential.

      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