Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: dieter Newsgroups: comp.lang.python Subject: Re: [smtplib] how to assure login was succesful? Date: Wed, 25 May 2016 10:23:35 +0200 Lines: 8 Message-ID: References: <8737p6tuk8.fsf@handshake.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.uni-berlin.de ZuEejwYqq/42qPC3x0yGdQ8pYD/rPhYcsAnos+oBL68w== Cancel-Lock: sha1:6DaNOM2m782PK4Z6IS88KzazUCw= Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:: [': 0.03; 'exception.': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'tuple': 0.09; 'python': 0.10; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'received:t-ipconnect.de': 0.16; 'subject:login': 0.16; 'subject:] ': 0.19; '(where': 0.23; 'this:': 0.23; 'script': 0.25; 'header :User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'reaches': 0.27; 'host': 0.28; 'skip:s 30': 0.31; 'point': 0.33; 'server': 0.34; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'expect': 0.37; 'received:org': 0.37; 'charset:us-ascii': 0.37; 'skip:s 40': 0.38; 'wrong': 0.38; 'to:addr:python.org': 0.40; 'where': 0.40; 'received:de': 0.40; 'some': 0.40; 'account': 0.66; 'login.': 0.93 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: p57b39b30.dip0.t-ipconnect.de User-Agent: Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.22 (linux) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <8737p6tuk8.fsf@handshake.de> X-Mailman-Original-References: Xref: csiph.com comp.lang.python:109104 maurice writes: > Once my python script reaches the point where I login in my email account with: server.login(username,password) (where server server = smtplib.SMTP('smtp.office365.com:587')), it returns a tuple like this: > > (235, > '2.7.0 Authentication successful target host [address here]') Try a wrong login. I would expect you to get some kind of exception.