[Tutor] smtplib with yahoo smtp server

Intercodes intercodes at gmail.com
Wed Feb 1 11:42:17 CET 2006


>
> Ewald,




> > ------------------------------------------------------
> >>>> ex= smtplib.SMTP('smtp.mail.yahoo.com <http://smtp.mail.yahoo.com>')
> > Traceback (most recent call last):
> >   File "<stdin>", line 1, in ?
> >   File "/usr/lib/python2.4/smtplib.py", line 241, in __init__
> >     (code, msg) = self.connect(host, port)
> >   File "/usr/lib/python2.4/smtplib.py", line 289, in connect
> >     for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM):
> > socket.gaierror: (-2, 'Name or service not known')
> >
> > ------------------------------------------------
>
I am sorry , that's a mistake on my part. This output corresponds to a  typo
input data. The error you saw previously was the original one (the one with
error on line 255...). I corrected the typo while posting it ( ..I thought
the error was same)


------------------------------------------------------------------

> >the call should be socket.getaddrinfo( "smtp.mail.yahoo.com", 25, 0, >
> socket.SOCK_STREAM );
>

>>>socket.getaddrinfo('smtp.mail.yahoo.com',25,0,socket.SOCK_STREAM)
[(2, 1, 6, '', ('216.136.173.18', 25))]

--------------------------------------------------------------

How do you resolve your hostnames ( /etc/nsswitch.conf gives the order of
> hostname resolution )


My nssswitch.conf
----------------------------------
passwd: compat
group:  compat

hosts:          files dns
networks:       files dns

services:       files
protocols:      files
rpc:            files
ethers:         files
netmasks:       files
netgroup:       files
publickey:      files

bootparams:     files
automount:      files nis
aliases:        files

 ---------------------------------------------------------------------------------------------

>This should resolve your own local hostname!
> >The socket.gethostbyname() is a call into a shared object of Python and
> this >would use ( So think I ) the standard-Libraries for resolution.


You totally lost me here :)
-----------------------------------------------------------------------------

> >Is "linux" a valid hostname?
> >Does "ping linux" succeed.


I suppose not.

linux:/srv/ # ping linux
ping: unknown host linux
--------------------------------------------------------------------------------------


--
Intercodes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20060201/260c6ed0/attachment.html 


More information about the Tutor mailing list