Popular Python recipes tagged "meta:requires=smtplib"http://code.activestate.com/recipes/langs/python/tags/meta:requires=smtplib/2013-03-23T10:01:02-07:00ActiveState Code RecipesSending Email in Python (Python) 2013-02-24T13:47:01-08:00James Millshttp://code.activestate.com/recipes/users/4167757/http://code.activestate.com/recipes/578472-sending-email-in-python/ <p style="color: grey"> Python recipe 578472 by <a href="/recipes/users/4167757/">James Mills</a> (<a href="/recipes/tags/email/">email</a>, <a href="/recipes/tags/email_sending/">email_sending</a>, <a href="/recipes/tags/sendmail/">sendmail</a>, <a href="/recipes/tags/smtp/">smtp</a>). </p> <p>Every Python Application needs to send email at some point. Whether it's for reporting errors, status updates or simply the core functionality of the system this little recipe should help! Documented and Tested.</p> Generic way to create a daemonized process in python (Python) 2012-03-26T14:56:17-07:00ajaymenon.khttp://code.activestate.com/recipes/users/4181225/http://code.activestate.com/recipes/578072-generic-way-to-create-a-daemonized-process-in-pyth/ <p style="color: grey"> Python recipe 578072 by <a href="/recipes/users/4181225/">ajaymenon.k</a> (<a href="/recipes/tags/daemon/">daemon</a>, <a href="/recipes/tags/process/">process</a>, <a href="/recipes/tags/threads/">threads</a>). Revision 4. </p> <p>A simple daemon that will constantly keep track the size of your inbox and when it exceeds a certain size, will send you a reminder email.</p> Send an HTML email with embedded image and plain text alternate (Python) 2011-06-12T18:38:14-07:00soham vaghelahttp://code.activestate.com/recipes/users/4178285/http://code.activestate.com/recipes/577751-send-an-html-email-with-embedded-image-and-plain-t/ <p style="color: grey"> Python recipe 577751 by <a href="/recipes/users/4178285/">soham vaghela</a> (<a href="/recipes/tags/network/">network</a>). </p> <p>HTML is the method of choice for those wishing to send emails with rich text, layout and graphics. Often it is desirable to embed the graphics within the message so recipients can display the message directly, without further downloads.</p> <p>Some mail agents don't support HTML or their users prefer to receive plain text messages. Senders of HTML messages should include a plain text message as an alternate for these users.</p> <p>This recipe sends a short HTML message with a single embedded image and an alternate plain text message.</p> Send an HTML email with embedded image and plain text alternate (Python) 2011-06-12T18:38:47-07:00soham vaghelahttp://code.activestate.com/recipes/users/4178285/http://code.activestate.com/recipes/577752-send-an-html-email-with-embedded-image-and-plain-t/ <p style="color: grey"> Python recipe 577752 by <a href="/recipes/users/4178285/">soham vaghela</a> (<a href="/recipes/tags/network/">network</a>). </p> <p>HTML is the method of choice for those wishing to send emails with rich text, layout and graphics. Often it is desirable to embed the graphics within the message so recipients can display the message directly, without further downloads.</p> <p>Some mail agents don't support HTML or their users prefer to receive plain text messages. Senders of HTML messages should include a plain text message as an alternate for these users.</p> <p>This recipe sends a short HTML message with a single embedded image and an alternate plain text message.</p> Python Gmail script (smtp) (Python) 2011-06-08T20:15:01-07:00jrovegnohttp://code.activestate.com/recipes/users/4170207/http://code.activestate.com/recipes/577690-python-gmail-script-smtp/ <p style="color: grey"> Python recipe 577690 by <a href="/recipes/users/4170207/">jrovegno</a> (<a href="/recipes/tags/gmail/">gmail</a>, <a href="/recipes/tags/smtp/">smtp</a>). Revision 4. </p> <p>Referencias: <a href="http://ideaschile.wordpress.com/2011/05/12/python-gmail-script-smtp/">Python Gmail script (smtp)</a></p> Send an HTML email with embedded image and plain text alternate (Python) 2006-01-29T18:40:36-08:00darrin massenahttp://code.activestate.com/recipes/users/1987292/http://code.activestate.com/recipes/473810-send-an-html-email-with-embedded-image-and-plain-t/ <p style="color: grey"> Python recipe 473810 by <a href="/recipes/users/1987292/">darrin massena</a> (<a href="/recipes/tags/network/">network</a>). </p> <p>HTML is the method of choice for those wishing to send emails with rich text, layout and graphics. Often it is desirable to embed the graphics within the message so recipients can display the message directly, without further downloads.</p> <p>Some mail agents don't support HTML or their users prefer to receive plain text messages. Senders of HTML messages should include a plain text message as an alternate for these users.</p> <p>This recipe sends a short HTML message with a single embedded image and an alternate plain text message.</p> sending gmail though python code (Python) 2013-03-23T10:01:02-07:00Raghuramhttp://code.activestate.com/recipes/users/4174757/http://code.activestate.com/recipes/577371-sending-gmail-though-python-code/ <p style="color: grey"> Python recipe 577371 by <a href="/recipes/users/4174757/">Raghuram</a> (<a href="/recipes/tags/python_scripts/">python_scripts</a>). Revision 2. </p> <p>sending gmail though your python code</p> ironpython script to Monitor Servers internal CPU temprature using WMI MSAcpi_ThermalZoneTemperature with e-mail alerting capability (Python) 2010-03-12T05:25:52-08:00mgarrana Garranahttp://code.activestate.com/recipes/users/4171135/http://code.activestate.com/recipes/577103-ironpython-script-to-monitor-servers-internal-cpu-/ <p style="color: grey"> Python recipe 577103 by <a href="/recipes/users/4171135/">mgarrana Garrana</a> (<a href="/recipes/tags/cputemprature/">cputemprature</a>, <a href="/recipes/tags/ironpython/">ironpython</a>, <a href="/recipes/tags/managementobjectsearcher/">managementobjectsearcher</a>, <a href="/recipes/tags/msacpi_thermalzonetemperature/">msacpi_thermalzonetemperature</a>, <a href="/recipes/tags/smtplib/">smtplib</a>, <a href="/recipes/tags/wmi/">wmi</a>). </p> <p>ironpython script. It reads a txt file called servers.txt where it contains server names each in a separate line . it executes the function remoteconnect on each server name , the function connects to the server and reads the internal CPU TEMP from the WMI class MSAcpi_ThermalZoneTemperature located in namespace \root\WMI if internal CPU temp exceeds a certian Threshold , the function sends an alerting e-mail , it can also execute any other desired action using the same concept like sending an alerting sms</p> Send HTML or Text email with or without attachments (Python) 2009-07-27T13:14:24-07:00Isaac Wagnerhttp://code.activestate.com/recipes/users/4171255/http://code.activestate.com/recipes/576858-send-html-or-text-email-with-or-without-attachment/ <p style="color: grey"> Python recipe 576858 by <a href="/recipes/users/4171255/">Isaac Wagner</a> (<a href="/recipes/tags/email/">email</a>, <a href="/recipes/tags/smtp/">smtp</a>). </p> <p>Using code gleaned from the net and from my own brain I created this convenient wrapper to send email messages via SMTP in Python. This class allows you to send plain text email messages or HTML encoded messages. You can also add attachments to the messages.</p> send a multipart email (Python) 2009-10-15T13:56:10-07:00Trent Mickhttp://code.activestate.com/recipes/users/4173505/http://code.activestate.com/recipes/576931-send-a-multipart-email/ <p style="color: grey"> Python recipe 576931 by <a href="/recipes/users/4173505/">Trent Mick</a> (<a href="/recipes/tags/email/">email</a>, <a href="/recipes/tags/multipart/">multipart</a>, <a href="/recipes/tags/smtp/">smtp</a>). Revision 2. </p> <p>A simple function to send an email (can specify text and html parts).</p> <p>See also: <a href="http://code.activestate.com/recipes/576824/">Recipe 576824</a> (send via Gmail's SMTP server), <a href="http://code.activestate.com/recipes/576858/">Recipe 576858</a> (more complex, but supports attachments).</p> send a multipart email via gmail's SMTP server (Python) 2009-12-21T14:29:41-08:00Trent Mickhttp://code.activestate.com/recipes/users/4173505/http://code.activestate.com/recipes/576824-send-a-multipart-email-via-gmails-smtp-server/ <p style="color: grey"> Python recipe 576824 by <a href="/recipes/users/4173505/">Trent Mick</a> (<a href="/recipes/tags/email/">email</a>, <a href="/recipes/tags/gmail/">gmail</a>, <a href="/recipes/tags/smtp/">smtp</a>). Revision 3. </p> <p>This is a Python function to send an email (a) with optional text and html alternative parts and (b) via gmail's SMTP server using your gmail account.</p> Send Email (Python) 2012-08-26T11:23:54-07:00sfwgeekhttp://code.activestate.com/recipes/users/4170734/http://code.activestate.com/recipes/576807-send-email/ <p style="color: grey"> Python recipe 576807 by <a href="/recipes/users/4170734/">sfwgeek</a> (<a href="/recipes/tags/argparse/">argparse</a>, <a href="/recipes/tags/cli/">cli</a>, <a href="/recipes/tags/command/">command</a>, <a href="/recipes/tags/email/">email</a>, <a href="/recipes/tags/interface/">interface</a>, <a href="/recipes/tags/line/">line</a>, <a href="/recipes/tags/mail/">mail</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/send/">send</a>, <a href="/recipes/tags/smtplib/">smtplib</a>). Revision 5. </p> <p>A Command Line Interface (CLI) program to send email.</p> Code to solve Smoluchowsky Equation (Python) 2008-10-31T06:25:13-07:00Lorenzo Isellahttp://code.activestate.com/recipes/users/4143130/http://code.activestate.com/recipes/576547-code-to-solve-smoluchowsky-equation/ <p style="color: grey"> Python recipe 576547 by <a href="/recipes/users/4143130/">Lorenzo Isella</a> (<a href="/recipes/tags/email_sending/">email_sending</a>, <a href="/recipes/tags/nonlinear/">nonlinear</a>, <a href="/recipes/tags/pylab/">pylab</a>, <a href="/recipes/tags/scipy/">scipy</a>, <a href="/recipes/tags/smoluchowski/">smoluchowski</a>). </p> <p>This is a research code which solves Smoluchowski equation for coalescing particles. It also can login into a gmail account (login data to be obviously provided by the user) and send an email with one of the generated output pdf files as an attachment.</p> I will download all of the recipes from the Python Cookbook, new contest (Python) 2008-02-19T13:43:14-08:00pee onehttp://code.activestate.com/recipes/users/4110953/http://code.activestate.com/recipes/543267-i-will-download-all-of-the-recipes-from-the-python/ <p style="color: grey"> Python recipe 543267 by <a href="/recipes/users/4110953/">pee one</a> . Revision 9. </p> <p>I will download all of the recipes from the Python Cookbook Includes a Tk input interface and a new contest (replaces previous recipes: 541083, 542189, and 542196))</p> Compose HTML Mail with embedded images from URL or local file (Python) 2006-02-06T12:10:55-08:00Catalin Constantinhttp://code.activestate.com/recipes/users/2766393/http://code.activestate.com/recipes/473851-compose-html-mail-with-embedded-images-from-url-or/ <p style="color: grey"> Python recipe 473851 by <a href="/recipes/users/2766393/">Catalin Constantin</a> . </p> <p>The thing about this class is to "build" a mail msg object, automatic, from an URL or a local html file WITH all images included. The class takes care of the image parsing / downloading / embedding + "cid: ID-here" replacements. The return is a valid MIMEMultipart("related") msg object which can be used to send valid HTML mail.</p> Email pretty tracebacks to yourself (or someone you love) (Python) 2005-10-19T08:13:27-07:00Cliff Wellshttp://code.activestate.com/recipes/users/2631558/http://code.activestate.com/recipes/442459-email-pretty-tracebacks-to-yourself-or-someone-you/ <p style="color: grey"> Python recipe 442459 by <a href="/recipes/users/2631558/">Cliff Wells</a> (<a href="/recipes/tags/debugging/">debugging</a>). </p> <p>Even production applications have bugs, and it would be nice to have Python tracebacks emailed to you rather than dumped to the hapless user's screen. This recipe shows you how.</p> Private clearcase views backup. (Python) 2004-08-28T23:39:13-07:00Luigi Podericohttp://code.activestate.com/recipes/users/2007933/http://code.activestate.com/recipes/302477-private-clearcase-views-backup/ <p style="color: grey"> Python recipe 302477 by <a href="/recipes/users/2007933/">Luigi Poderico</a> . </p> <p>Performes the backup of all private and checked out files in all local clearcase views.</p> Foreign Exchange Rate Alert, CSV version ($CAD<->$USD) (Python) 2011-12-09T07:32:23-08:00Victor Yanghttp://code.activestate.com/recipes/users/627255/http://code.activestate.com/recipes/252546-foreign-exchange-rate-alert-csv-version-cad-usd/ <p style="color: grey"> Python recipe 252546 by <a href="/recipes/users/627255/">Victor Yang</a> (<a href="/recipes/tags/forex/">forex</a>, <a href="/recipes/tags/web/">web</a>). Revision 11. </p> <ul> <li>The following code snippet can be used as daily crontab or windows scheduled task to watch the foreign exchange rate from BankOfCanada web site. </li> <li><p>The file format is not fancy XML but a simple CSV for noon rate for last 5 days. </p></li> <li><p>urllib2.urlopen is used as it can auto detect the proxy if it is used. </p></li> <li>The default url connnect timeout is 60 seconds here.</li> </ul> Wrapping template engine and template document (Python) 2003-05-08T13:23:50-07:00Keisuke URAGOhttp://code.activestate.com/recipes/users/668964/http://code.activestate.com/recipes/198823-wrapping-template-engine-and-template-document/ <p style="color: grey"> Python recipe 198823 by <a href="/recipes/users/668964/">Keisuke URAGO</a> (<a href="/recipes/tags/text/">text</a>). </p> <p>It is not so easy to put template engine and the template itself together, and to separate logic and a template. This example should define the value substituted for the slot of the easy source code for using template engine, the function of template engine, a template, and a template, and they should operate well by calling using render function.</p> <p>Below is an e-mail generate and sendings.</p> IPy Notify (Python) 2002-11-19T17:28:45-08:00Charles Nicholshttp://code.activestate.com/recipes/users/818943/http://code.activestate.com/recipes/162994-ipy-notify/ <p style="color: grey"> Python recipe 162994 by <a href="/recipes/users/818943/">Charles Nichols</a> . Revision 6. </p> <p>Use: To notify whomever that your IP address has changed if you have a non-static IP address and run a web server, game server, etc. Utilizes nested functions.</p>