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()
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
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