{ "info": { "author": "David Foster", "author_email": "davidfstr@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Topic :: Communications :: Email", "Topic :: Communications :: Email :: Mail Transport Agents", "Topic :: System :: Systems Administration" ], "description": "notifymail\n==========\n\n``notifymail`` allows scripts to send email to a preconfigured address.\nIt is particularly useful for unattended and scheduled scripts to report\ntheir status to an administrator.\n\n``notifymail`` is designed to be very easy to install and use. I wrote\nit because I couldn't figure out how to configure the built-in\n``sendmail`` command to forward emails appropriately and I couldn't get\nthe similar ``ssmtp`` package to work.\n\nRequirements\n------------\n\n- OS X or Linux\n- Python 2.7 or 3.4\n- An email account\n\nInstallation\n------------\n\n::\n\n $ pip install notifymail # or pip3 (for Python 3.x)\n\nConfiguration\n-------------\n\nYou must know the SMTP settings of your email provider, which can\ntypically looked up on your provider's website. For example here are\n`Gmail's SMTP\nsettings `__,\nobtained with a internet search for \"gmail SMTP settings\":\n\n- **Gmail SMTP Server:** smtp.gmail.com\n- **Gmail SMTP Port:** 587 (for TLS)\n- **Gmail SMTP Uses TLS?** yes\n\nUsually your SMTP username will be the same as your email address, and\nyour SMTP password will be the same as your email password.\n\nOnce you have the settings in hand, run the ``notifymail.py --setup``\ncommand:\n\n::\n\n $ notifymail.py --setup\n SMTP Server Hostname: smtp.gmail.com\n SMTP Server Port [465]: 587\n SMTP Server Uses TLS (y/n) [n]: yes\n SMTP Username: robot@gmail.com\n SMTP Password: ********\n From Address [robot@gmail.com]: robot@gmail.com\n From Name (optional) []: notifymail\n To Address: admin@example.com\n\n Verifying connection to SMTP server... OK\n\nUsage\n-----\n\nFrom the Command Line\n~~~~~~~~~~~~~~~~~~~~~\n\n::\n\n $ echo \"Hello World\" | notifymail.py -s \"Subject\"\n\n``notifymail`` will read the message body from standard input and allow\nyou to specify a subject line with the ``-s`` option. You may also\nspecify a custom sender name using the ``--from-name`` option.\n\nIn Python 2 the encoding of the message body and all arguments is\nassumed to be UTF-8. In Python 3 the encoding of both is autodetected in\n`the usual\nfashion `__.\n\nFull usage information:\n\n::\n\n Usage: notifymail.py --setup | -s SUBJECT [-b BODY] [--from-name NAME] | --probe\n\n Options:\n -h, --help show this help message and exit\n --setup setup mail server configuration\n --probe check whether mail server is reachable\n -s SUBJECT, --subject=SUBJECT\n subject line. Required.\n -b BODY, --body=BODY body. Read from standard input if omitted.\n --from-name=NAME sender name. Overrides the default sender name.\n\nFrom a Python Script\n~~~~~~~~~~~~~~~~~~~~\n\n::\n\n import notifymail\n notifymail.send('Subject', 'Hello World')\n\nString arguments can be either Unicode strings or UTF-8 encoded\nbytestrings.\n\nFrom a Non-Python Script\n~~~~~~~~~~~~~~~~~~~~~~~~\n\nJust execute the ``notifymail`` command using your language's normal API\nfor running system commands.\n\nFor example, in Ruby:\n\n::\n\n require 'open3'\n\n Open3.popen3('notifymail.py', '-s', 'Subject') {|stdin, stdout, stderr, wait_thr|\n stdin.puts('Hello World!')\n stdin.close\n \n exit_code = wait_thr.value.to_i\n if exit_code != 0\n raise \"notifymail exited with error code #{exit_code}.\"\n end\n }\n\nFor example, in Java:\n\n::\n\n import java.io.*;\n\n try {\n Process notifymail = Runtime.getRuntime().exec(new String[] {\n \"notifymail.py\", \"-s\", \"Subject\" });\n PrintStream stdin = new PrintStream(\n notifymail.getOutputStream(), /*autoFlush=*/false, \"UTF-8\");\n \n stdin.println(\"Hello World!\");\n stdin.close();\n \n int exitCode = notifymail.waitFor();\n if (exitCode != 0) {\n throw new Exception(\"notifymail exited with error code \" + exitCode + \".\");\n }\n } catch (Exception e) {\n throw new RuntimeException(\"Unable to send email.\", e);\n }\n\nLimitations\n-----------\n\n- The configured SMTP settings are stored in plaintext, including the\n SMTP password.\n\nLicense\n-------\n\nThis code is provided under the MIT License.\n\nRelease Notes\n-------------\n\n- 1.1\n\n - Add support for Python 3.4. Remove support for Python 2.6.\n - Fix ``--from-name`` to actually work.\n - Fix ``--setup`` to not print usage info after completing setup.\n\n- 1.0\n\n - Initial version.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/davidfstr/notifymail/", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "notifymail", "package_url": "https://pypi.org/project/notifymail/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/notifymail/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/davidfstr/notifymail/" }, "release_url": "https://pypi.org/project/notifymail/1.1/", "requires_dist": null, "requires_python": null, "summary": "Allows scripts to send email to a preconfigured address.", "version": "1.1" }, "last_serial": 1569708, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "cb4041149033e2e65f4c3bb1e1402324", "sha256": "500cdf0601c9e90d4f1258f837393f26dc5610f0a583e031bc3f533bb5e45d5a" }, "downloads": -1, "filename": "notifymail-1.0.tar.gz", "has_sig": false, "md5_digest": "cb4041149033e2e65f4c3bb1e1402324", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5729, "upload_time": "2013-07-27T22:04:56", "url": "https://files.pythonhosted.org/packages/ba/72/36262e983041472e48ebd37c790beb0742474d4242852d2db91ec0387700/notifymail-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "bcae678cb317549aed59707ea7790bfb", "sha256": "ea9d5432e6e3461782db097e3943d9aa3d7dce961b2842590bb70a7a7fb3e220" }, "downloads": -1, "filename": "notifymail-1.1.tar.gz", "has_sig": false, "md5_digest": "bcae678cb317549aed59707ea7790bfb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5983, "upload_time": "2015-05-31T07:25:50", "url": "https://files.pythonhosted.org/packages/18/4b/b47a681834cea6da028e9aaee59691773309bea36c746209188607c36987/notifymail-1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "bcae678cb317549aed59707ea7790bfb", "sha256": "ea9d5432e6e3461782db097e3943d9aa3d7dce961b2842590bb70a7a7fb3e220" }, "downloads": -1, "filename": "notifymail-1.1.tar.gz", "has_sig": false, "md5_digest": "bcae678cb317549aed59707ea7790bfb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5983, "upload_time": "2015-05-31T07:25:50", "url": "https://files.pythonhosted.org/packages/18/4b/b47a681834cea6da028e9aaee59691773309bea36c746209188607c36987/notifymail-1.1.tar.gz" } ] }