<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Sending Emails using WiFi (GPy)]]></title><description><![CDATA[<p dir="auto">Hi,<br />
Looks like Singapore only allows businesses to use their CAT-M1 and NB-IOT services so I am stuck with WiFi. If I am not wrong, the only way of communicating with other devices is through email. I found a tutorial online on how to send an email using Pycom and here's the code:</p>
<pre><code>def sendEmail():
    to = 'recipient@gmail.com'
    user = 'sender@gmail.com'
    pwd = 'password'
    smtpserver = smtplib.SMTP(&quot;smtp02.hostnet.nl&quot;, 587, tls=False)
    smtpserver.login(user, pwd)
    header = 'To:' + to + '\n' + 'From: ' + user + '\n' + 'Subject: Email from the GPy \n'
    msg = header + '\n Hi, \n this is The GPy emailing ;-) \n\n Cheers, \n The GPy'
    smtpserver.sendmail(user, to, msg)
    print(&quot;Check Inbox!&quot;)
    smtpserver.close()
</code></pre>
<p dir="auto">However, in the terminal, I am greeted by the following error message:</p>
<pre><code>File &quot;&lt;stdin&gt;&quot;, line 72, in sendEmail
  File &quot;/flash/lib/smtplib.py&quot;, line 259, in login
SMTPAuthenticationError: (535, b'authorization failed (#5.7.0)')
</code></pre>
<p dir="auto">Line 72 refers to</p>
<pre><code>header = 'To:' + to + '\n' + 'From: ' + user + '\n' + 'Subject: Email from the GPy \n'
</code></pre>
<p dir="auto">My suspicion is that the user and pwd or not meant to be email and the corresponding password but something else.<br />
Is there an alternative way of sending an email or is there a workaround?<br />
Also, is there maybe another way of communicating with devices through wifi instead of emails?</p>
<p dir="auto">Note, I did use legitimate email addresses and the correct password.</p>
<p dir="auto"><a href="https://forum.micropython.org/viewtopic.php?f=11&amp;t=1047&amp;start=10" target="_blank" rel="noopener noreferrer nofollow">Tutorial</a></p>
<p dir="auto">Thanks</p>
]]></description><link>https://forum.pycom.io/topic/6194/sending-emails-using-wifi-gpy</link><generator>RSS for Node</generator><lastBuildDate>Thu, 10 Sep 2026 03:37:22 GMT</lastBuildDate><atom:link href="https://forum.pycom.io/topic/6194.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 27 Jul 2020 12:32:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Sending Emails using WiFi (GPy) on Mon, 27 Jul 2020 12:32:18 GMT]]></title><description><![CDATA[<p dir="auto">Hi,<br />
Looks like Singapore only allows businesses to use their CAT-M1 and NB-IOT services so I am stuck with WiFi. If I am not wrong, the only way of communicating with other devices is through email. I found a tutorial online on how to send an email using Pycom and here's the code:</p>
<pre><code>def sendEmail():
    to = 'recipient@gmail.com'
    user = 'sender@gmail.com'
    pwd = 'password'
    smtpserver = smtplib.SMTP(&quot;smtp02.hostnet.nl&quot;, 587, tls=False)
    smtpserver.login(user, pwd)
    header = 'To:' + to + '\n' + 'From: ' + user + '\n' + 'Subject: Email from the GPy \n'
    msg = header + '\n Hi, \n this is The GPy emailing ;-) \n\n Cheers, \n The GPy'
    smtpserver.sendmail(user, to, msg)
    print(&quot;Check Inbox!&quot;)
    smtpserver.close()
</code></pre>
<p dir="auto">However, in the terminal, I am greeted by the following error message:</p>
<pre><code>File &quot;&lt;stdin&gt;&quot;, line 72, in sendEmail
  File &quot;/flash/lib/smtplib.py&quot;, line 259, in login
SMTPAuthenticationError: (535, b'authorization failed (#5.7.0)')
</code></pre>
<p dir="auto">Line 72 refers to</p>
<pre><code>header = 'To:' + to + '\n' + 'From: ' + user + '\n' + 'Subject: Email from the GPy \n'
</code></pre>
<p dir="auto">My suspicion is that the user and pwd or not meant to be email and the corresponding password but something else.<br />
Is there an alternative way of sending an email or is there a workaround?<br />
Also, is there maybe another way of communicating with devices through wifi instead of emails?</p>
<p dir="auto">Note, I did use legitimate email addresses and the correct password.</p>
<p dir="auto"><a href="https://forum.micropython.org/viewtopic.php?f=11&amp;t=1047&amp;start=10" target="_blank" rel="noopener noreferrer nofollow">Tutorial</a></p>
<p dir="auto">Thanks</p>
]]></description><link>https://forum.pycom.io/post/33661</link><guid isPermaLink="true">https://forum.pycom.io/post/33661</guid><dc:creator><![CDATA[Akul9092]]></dc:creator><pubDate>Mon, 27 Jul 2020 12:32:18 GMT</pubDate></item></channel></rss>