• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Module 4.6 Sens Sensor Readings via email

Q&A Forum › Category: ESP32 › Module 4.6 Sens Sensor Readings via email
0 Vote Up Vote Down
Jacques Boissieux asked 3 weeks ago

Hello ,
I change your script by another script with my parameter it’s ok
You can seee the script I used:
Can you tell me why your script fails.
Congratulations

&nbs
import umail

SMTP_PORT = 587
SMTP_HOST = “smtp.gmail.com” # “smtp.office365.com” for Outlook
SMTP_USERNAME = “xxxxxxxxxxxxxxx@gmail.com” #my new account
SMTP_PASSWORD = “xxxxxxxxxxxxxxx” #my app password

WIFI_AP_SSID = “xxxxxxxxxxxxxxx” # my ssid
WIFI_AP_PASSWORD = “xxxxxxxxxxxxxxx” #my box password

#connexion au réseau wifi
def do_connect():
import network
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
if not wlan.isconnected():
print(‘connecting to network…’)
wlan.connect(WIFI_AP_SSID, WIFI_AP_PASSWORD)
while not wlan.isconnected():
pass
print(‘network config:’, wlan.ifconfig())

if __name__ == “__main__”:
do_connect()
#type du smtp, port, adresse de l’expéditeur et mot de passe
smtp = umail.SMTP(host=SMTP_HOST, port=SMTP_PORT, username=SMTP_USERNAME, password=SMTP_PASSWORD)
#adressse du destinataire
smtp.to(addrs=[’email_destinataire@xxx.com’], mail_from=SMTP_USERNAME) # my email dest
#contenu du mail
smtp.write(“Subject: Mail Automatique\r\n”)
smtp.write(“MIME-Version: 1.0\n”)
smtp.write(‘Content-Type: text/html; charset=”UTF-8″\n’)
smtp.write(“Content-Transfer-Encoding: 7bit\n\n”)
smtp.send(”)
smtp.quit()

3 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 2 weeks ago

Hi.
Your new email address will be the sender email.
Your normal address will be the recipient email.

Let me know if you need more help.
Regards,
Sara

0 Vote Up Vote Down
Jacques Boissieux answered 2 weeks ago

Thank you Sara,
that’s what I deduced when rereading the article in your book

 

 

 

 

 

 

 

99 / 5 000

 

Sorry for my bad English, but I’m having other problems. I’ve created a new request.
Have a good day
Jacques B

0 Vote Up Vote Down
Sara Santos Staff answered 2 weeks ago

Great.
 
I’ll close this issue.
I already answered your other question.

Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn LVGL: Build GUIs for ESP32 Projects – Version 1.5 July 7, 2025
  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.