Here's how they did it on my PyTalk client .
Do not forget @ gmail.com in the user ID.
I think you should try connecting talk.google.com to port 5222.
Also try specifying ressource for auth.
import xmpp import sys userID = ' Your.Login@gmail.com ' password = 'YourPassword' ressource = 'Script' jid = xmpp.protocol.JID(userID) jabber = xmpp.Client(jid.getDomain(), debug=[]) connection = jabber.connect(('talk.google.com',5222)) if not connection: sys.stderr.write('Could not connect\n') else: sys.stderr.write('Connected with %s\n' % connection) auth = jabber.auth(jid.getNode(), password, ressource) if not auth: sys.stderr.write("Could not authenticate\n") else: sys.stderr.write('Authenticate using %s\n' % auth) jabber.sendInitPresence(requestRoster=1) jabber.send(xmpp.Message( " YourFriend@gmail.com " ,"Hello World form Python" ))
By the way, he is very close to Philip Answer
source share