Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news.mb-net.net!open-news-network.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.115 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.77; '*S*': 0.00; 'interpreter': 0.05; 'exception,': 0.09; 'exception.': 0.09; 'happen.': 0.09; 'python': 0.11; 'language,': 0.12; "wouldn't": 0.14; '(#1,': 0.16; 'balls': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'mail."""': 0.16; 'exception': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'normally': 0.19; '(the': 0.22; '31,': 0.24; 'fairly': 0.24; 'question': 0.24; "i've": 0.25; 'script': 0.25; 'least': 0.26; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'function': 0.29; 'am,': 0.29; 'raise': 0.29; "doesn't": 0.30; 'important.': 0.30; 'message-id:@mail.gmail.com': 0.30; 'skip:( 20': 0.30; 'code': 0.31; 'os,': 0.31; 'with,': 0.31; 'file': 0.32; 'stuff': 0.32; 'run': 0.32; 'text': 0.33; 'linux': 0.33; 'url:python': 0.33; 'running': 0.33; 'fri,': 0.33; 'actual': 0.34; 'subject:the': 0.34; 'could': 0.34; "can't": 0.35; 'received:209.85': 0.35; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'processed': 0.36; 'recipient.': 0.36; 'smtp': 0.36; 'next': 0.36; 'method': 0.36; 'useful': 0.36; 'subject:?': 0.36; 'should': 0.36; 'received:209': 0.37; 'clear': 0.37; 'server': 0.38; 'version,': 0.38; 'to:addr:python-list': 0.38; 'anything': 0.39; 'does': 0.39; 'help,': 0.39; 'quote': 0.39; 'structure': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'easy': 0.60; 'email?': 0.60; 'tell': 0.60; 'helps': 0.61; 'simple': 0.61; "you're": 0.61; 'first': 0.61; "you'll": 0.62; 'our': 0.64; 'more': 0.64; 'mar': 0.68; 'internet': 0.71; 'url:htm': 0.73; 'jul': 0.74; 'emails.': 0.78; 'email"': 0.84; 'laid': 0.84; 'pardon': 0.84; 'scary': 0.84; 'subject:Where': 0.84; 'absolutely': 0.87; '2013,': 0.91; 'opens': 0.91; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=tUNDMMoc3mwZgfzlCWGAmMv8sZ1yuXgdFuY8/rkXzAg=; b=cclk8zoUCYpZXzCenMeTKpC7nmImGQTH/7DPlDJYnWvHWfrCjUGFnf6Pd1XdTjVEaZ 0nrOuZFkXXSDQobhYPRtLsSsEPw3QruKSHGKCpqPrhXb8MaD+tpGA7txMGDAr//6kxSS EmnYWdeaGfk45+M3Xg4KQbz2fCuk0WYWf7rVL6BeJy5NFKeIdxMl8OmSa6hn0btwHJPh Rfm2YKWERvBLvchOcbPQuozavvOselqi5qpdqiRascJwC+H5eKCkJih4+3nsJz0N7yvW 82A6OnegGWS3VVLlc23wkbOIE7jcxw5kwcB/NMQOoF62vpH1vfQip77r3Av/7VIBUNGe kyQQ== MIME-Version: 1.0 X-Received: by 10.68.251.200 with SMTP id zm8mr9979396pbc.54.1369952033446; Thu, 30 May 2013 15:13:53 -0700 (PDT) In-Reply-To: <7572490.mfSH6Zg6jY@mach-114-20> References: <5190b049$0$29978$c3e8da3$5496439d@news.astraweb.com> <4773190.v3vY0HWMWS@mach-114-20> <7572490.mfSH6Zg6jY@mach-114-20> Date: Fri, 31 May 2013 08:13:53 +1000 Subject: Re: sendmail smtplib.SMTP('localhost') Where is the email? From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 53 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1369952036 news.xs4all.nl 15864 [2001:888:2000:d::a6]:48090 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:46548 On Fri, May 31, 2013 at 5:48 AM, inq1ltd wrote: > python help, > > I've tried this code which I got from: > > http://www.tutorialspoint.com/python/python_sending_email.htm > > I build this file and run it > > After running the the file and I get > > "Successfully sent email" > > My question is why doesn't webmaster get an email? First point: Please send *plain text* emails. Your message came out double-spaced and with absolutely no indentation, which destroys the structure of Python code. (Your script is sufficiently simple that it's fairly clear how it had to be laid out, but when you force us to use our crystal balls for simple stuff like indentation, we can't use them again for something more important. The cooldown on these babies is pretty stiff sometimes.) Secondly, it helps a LOT to tell us what you're running under - Python version, OS, etc. One easy way to do that is to quote the text that the interactive interpreter opens with, eg: Python 2.4.5 (#1, Jul 22 2011, 02:01:04) [GCC 4.1.1] on mingw32 Python 3.4.0a0 (default:5dcd7ee0716a, Mar 30 2013, 08:17:06) [GCC 4.7.2] on linux Now, on to your actual code. The docs say: """This method will return normally if the mail is accepted for at least one recipient. Otherwise it will raise an exception. That is, if this method does not raise an exception, then someone should get your mail.""" That's nice confidence-inducing language, but I take exception (if you'll pardon the pun) to the last part. The only thing this function can know is that the mail has been accepted by the next hop. After that... well, the internet is a scary place, anything could happen. See if your SMTP server (the one running on localhost) has a nice log; you may be able to watch the message get processed by the next hop. By the way, I wouldn't bother with the try/except here. Just let the exception bubble up and be emitted to stderr. It'll be more useful that way :) ChrisA