python 3.x - why do i get network is unreachable error in my smtp program? -
import smtplib fromadd = 'xyz@gmail.com' = fromadd data = 'hello' server = smtplib.smtp('www.gmail.com') server.ehlo() server.starttls() server.set_debuglevel(1) server.login(fromadd,'pwd') server.sendmail(fromadd, to, data) server.quit()
in program above, got oserror: [errno 101] network unreachable error message on screen when execute it, why happen , how correct it?
in program, tell connect www.gmail.com
, domain not email server, , @marcelm noticed. try using gmail.com
or mail.google.com
.
Comments
Post a Comment