Re: sendmail smtplib.SMTP('localhost') Where is the email?
Your responses helped. The mailg for linux gave me information I didn't expect. regards, jol On Friday, May 31, 2013 08:55:12 AM Cameron Simpson wrote: > On 30May2013 15:48, inq1ltd wrote: > | python help, > > Please do not make new discussions by replying to an old discussion. > > It is not enough to change the subject line; unless you also remove > any References: and In-Reply-To: header lines your message is still > considered part of the old discussion. > > | 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 > > [...] > > |smtpObj = smtplib.SMTP('localhost') > |smtpObj.sendmail(sender, receivers, message) > |print "Successfully sent email" > > [...] > > | After running the the file and I get > | "Successfully sent email" > | > | My question is why doesn't webmaster get an email? > > Well, this suggests that the message has been accepted by the mail > system on localhost. Not that final delivery was made anywhere else. > > You now have to read the log files on your mail system to see what happened. > > One easy check to do first is to see if it is still in your mail > system but undelivered. On a UNIX system running the command: > > mailq > > should tell you that. If the queue is empty, the message has been > sent somewhere and you must dig through the logs to find out where. > If the message is in the queue then the "mailq" command will probably > give a suggestion as to why. > > Cheers,-- http://mail.python.org/mailman/listinfo/python-list
Re: sendmail smtplib.SMTP('localhost') Where is the email?
On 30May2013 15:48, inq1ltd wrote: | python help, Please do not make new discussions by replying to an old discussion. It is not enough to change the subject line; unless you also remove any References: and In-Reply-To: header lines your message is still considered part of the old discussion. | 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 [...] |smtpObj = smtplib.SMTP('localhost') |smtpObj.sendmail(sender, receivers, message) |print "Successfully sent email" [...] | After running the the file and I get | "Successfully sent email" | | My question is why doesn't webmaster get an email? Well, this suggests that the message has been accepted by the mail system on localhost. Not that final delivery was made anywhere else. You now have to read the log files on your mail system to see what happened. One easy check to do first is to see if it is still in your mail system but undelivered. On a UNIX system running the command: mailq should tell you that. If the queue is empty, the message has been sent somewhere and you must dig through the logs to find out where. If the message is in the queue then the "mailq" command will probably give a suggestion as to why. Cheers, -- Cameron Simpson As you can see, unraveling even a small part of 'sendmail' can introduce more complexity than answers.- Brian Costales, _sendmail_ -- http://mail.python.org/mailman/listinfo/python-list
Re: sendmail smtplib.SMTP('localhost') Where is the email?
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 -- http://mail.python.org/mailman/listinfo/python-list
sendmail smtplib.SMTP('localhost') Where is the email?
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 ---//--- #!/usr/bin/python import smtplib sender = "inq1...@inqvista.com" receivers = ["webmas...@inqvista.com"] message = """From: jol To: webmaster Subject: SMTP e-mail test This is a test e-mail message. """ try: smtpObj = smtplib.SMTP('localhost') smtpObj.sendmail(sender, receivers, message) print "Successfully sent email" except SMTPException: print "Error: unable to send email" --//-- After running the the file and I get "Successfully sent email" My question is why doesn't webmaster get an email? jol -- http://mail.python.org/mailman/listinfo/python-list