Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OSError with SMPT script
#1
Hello team,

I have the following code

import smtplib

my_email = "[email protected]"
password = "asdfasdf"
connection = smtplib.SMTP("smtp.gmail.com")

connection.starttls()
connection.login(user=my_email, password=password)
connection.sendmail(from_addr=my_email, to_addrs="[email protected]", msg="Hello")
connection.close()
It displays the following error

Error:
OSError: [Errno 101] Network is unreachable
Could you please assist? Can't find anything helpful online.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  OSError occurs in Linux. anna17 2 315 Mar-23-2024, 10:00 PM
Last Post: snippsat
  OSERROR When mkdir Oshadha 4 1,718 Jun-29-2022, 08:50 AM
Last Post: DeaD_EyE
  OSError: Unable to load libjvm when connecting to hdfs with pyarrow 3.0.0 aupres 0 3,177 Mar-22-2021, 10:25 AM
Last Post: aupres
  pyarrow throws oserror winerror 193 1 is not a valid win32 application aupres 2 3,797 Oct-21-2020, 01:04 AM
Last Post: aupres
  OSError: [Errno 26] Text file busy: '/var/tmp/tmp5qbeydbp batchenr 1 4,230 Mar-20-2020, 01:58 PM
Last Post: ibreeden
  Multiprocessing OSError 'too many open files' DreamingInsanity 3 10,387 Dec-27-2019, 04:50 PM
Last Post: DreamingInsanity
  .py to exe error "oserror winerror 193" michael1789 3 4,899 Dec-03-2019, 05:49 AM
Last Post: michael1789
  OSError: [Errno 13] Permission denied Kolterdyx 3 17,891 Sep-07-2018, 11:01 AM
Last Post: Gribouillis
  OSError: [Errno 22] Invalid argument - wasn't there last time I ran the code! meganhollie 2 9,219 Jun-11-2018, 06:01 PM
Last Post: meganhollie
  [SOLVED] OSError: [Errno 22] Invalid argument Panda 13 44,031 Jun-04-2018, 08:33 PM
Last Post: volcano63

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020