[code.view]

[top] / python / PyMOTW / docs / smtplib / index.html


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>smtplib – Simple Mail Transfer Protocol client &mdash; Python Module of the Week</title>
    <link rel="stylesheet" href="../_static/sphinxdoc.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '1.132',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="author" title="About these documents" href="../about.html" />
    <link rel="top" title="Python Module of the Week" href="../index.html" />
    <link rel="up" title="Internet Protocols and Support" href="../internet_protocols.html" />
    <link rel="next" title="socket – Network Communication" href="../socket/index.html" />
    <link rel="prev" title="smtpd – Sample SMTP Servers" href="../smtpd/index.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="../socket/index.html" title="socket – Network Communication"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="../smtpd/index.html" title="smtpd – Sample SMTP Servers"
             accesskey="P">previous</a> |</li>
        <li><a href="../contents.html">PyMOTW</a> &raquo;</li>
          <li><a href="../internet_protocols.html" accesskey="U">Internet Protocols and Support</a> &raquo;</li> 
      </ul>
    </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../contents.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">smtplib &#8211; Simple Mail Transfer Protocol client</a><ul>
<li><a class="reference internal" href="#sending-an-email-message">Sending an Email Message</a></li>
<li><a class="reference internal" href="#authentication-and-encryption">Authentication and Encryption</a></li>
<li><a class="reference internal" href="#verifying-an-email-address">Verifying an Email Address</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="../smtpd/index.html"
                        title="previous chapter">smtpd &#8211; Sample SMTP Servers</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="../socket/index.html"
                        title="next chapter">socket &#8211; Network Communication</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../_sources/smtplib/index.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" size="18" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="module-smtplib">
<span id="smtplib-simple-mail-transfer-protocol-client"></span><h1>smtplib &#8211; Simple Mail Transfer Protocol client<a class="headerlink" href="#module-smtplib" title="Permalink to this headline">¶</a></h1>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Purpose:</th><td class="field-body">Interact with SMTP servers, including sending email.</td>
</tr>
<tr class="field"><th class="field-name">Python Version:</th><td class="field-body">1.5.2 and later</td>
</tr>
</tbody>
</table>
<p><a class="reference internal" href="#module-smtplib" title="smtplib: Simple mail transfer protocol client."><tt class="xref py py-mod docutils literal"><span class="pre">smtplib</span></tt></a> includes the class <tt class="xref py py-class docutils literal"><span class="pre">SMTP</span></tt>, which is useful for communicating with mail servers to send mail.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The email addresses, host names, and IP addresses in the following examples have been
obscured, but otherwise the transcripts illustrate the sequence of commands and responses
accurately.</p>
</div>
<div class="section" id="sending-an-email-message">
<h2>Sending an Email Message<a class="headerlink" href="#sending-an-email-message" title="Permalink to this headline">¶</a></h2>
<p>The most common use of <tt class="xref py py-class docutils literal"><span class="pre">SMTP</span></tt> is to connect to a mail server and send a message.  The mail server host name and port can be passed to the constructor, or you can use <tt class="docutils literal"><span class="pre">connect()</span></tt> explicitly.  Once connected, just call <tt class="docutils literal"><span class="pre">sendmail()</span></tt> with the envelope parameters and body of the message.  The message text should be a fully formed <span class="target" id="index-0"></span><a class="rfc reference external" href="http://tools.ietf.org/html/rfc2882.html"><strong>RFC 2882</strong></a>-compliant message, since smtplib does not modify the contents or headers at all.  That means you need to add the <tt class="docutils literal"><span class="pre">From</span></tt> and <tt class="docutils literal"><span class="pre">To</span></tt> headers yourself.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">smtplib</span>
<span class="kn">import</span> <span class="nn">email.utils</span>
<span class="kn">from</span> <span class="nn">email.mime.text</span> <span class="kn">import</span> <span class="n">MIMEText</span>

<span class="c"># Create the message</span>
<span class="n">msg</span> <span class="o">=</span> <span class="n">MIMEText</span><span class="p">(</span><span class="s">&#39;This is the body of the message.&#39;</span><span class="p">)</span>
<span class="n">msg</span><span class="p">[</span><span class="s">&#39;To&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">email</span><span class="o">.</span><span class="n">utils</span><span class="o">.</span><span class="n">formataddr</span><span class="p">((</span><span class="s">&#39;Recipient&#39;</span><span class="p">,</span> <span class="s">&#39;recipient@example.com&#39;</span><span class="p">))</span>
<span class="n">msg</span><span class="p">[</span><span class="s">&#39;From&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">email</span><span class="o">.</span><span class="n">utils</span><span class="o">.</span><span class="n">formataddr</span><span class="p">((</span><span class="s">&#39;Author&#39;</span><span class="p">,</span> <span class="s">&#39;author@example.com&#39;</span><span class="p">))</span>
<span class="n">msg</span><span class="p">[</span><span class="s">&#39;Subject&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s">&#39;Simple test message&#39;</span>

<span class="n">server</span> <span class="o">=</span> <span class="n">smtplib</span><span class="o">.</span><span class="n">SMTP</span><span class="p">(</span><span class="s">&#39;mail&#39;</span><span class="p">)</span>
<span class="n">server</span><span class="o">.</span><span class="n">set_debuglevel</span><span class="p">(</span><span class="bp">True</span><span class="p">)</span> <span class="c"># show communication with the server</span>
<span class="k">try</span><span class="p">:</span>
    <span class="n">server</span><span class="o">.</span><span class="n">sendmail</span><span class="p">(</span><span class="s">&#39;author@example.com&#39;</span><span class="p">,</span> <span class="p">[</span><span class="s">&#39;recipient@example.com&#39;</span><span class="p">],</span> <span class="n">msg</span><span class="o">.</span><span class="n">as_string</span><span class="p">())</span>
<span class="k">finally</span><span class="p">:</span>
    <span class="n">server</span><span class="o">.</span><span class="n">quit</span><span class="p">()</span>
</pre></div>
</div>
<p>In this example, debugging is also turned on to show the communication between client and server.  Otherwise the example would produce no output at all.</p>
<div class="highlight-python"><pre>$ python smtplib_sendmail.py
send: 'ehlo localhost.local\r\n'
reply: '250-mail.example.com Hello [192.168.1.17], pleased to meet you\r\n'
reply: '250-ENHANCEDSTATUSCODES\r\n'
reply: '250-PIPELINING\r\n'
reply: '250-8BITMIME\r\n'
reply: '250-SIZE\r\n'
reply: '250-DSN\r\n'
reply: '250-ETRN\r\n'
reply: '250-AUTH GSSAPI DIGEST-MD5 CRAM-MD5\r\n'
reply: '250-DELIVERBY\r\n'
reply: '250 HELP\r\n'
reply: retcode (250); Msg: mail.example.com Hello [192.168.1.17], pleased to meet you
ENHANCEDSTATUSCODES
PIPELINING
8BITMIME
SIZE
DSN
ETRN
AUTH GSSAPI DIGEST-MD5 CRAM-MD5
DELIVERBY
HELP
send: 'mail FROM:&lt;author@example.com&gt; size=266\r\n'
reply: '250 2.1.0 &lt;author@example.com&gt;... Sender ok\r\n'
reply: retcode (250); Msg: 2.1.0 &lt;author@example.com&gt;... Sender ok
send: 'rcpt TO:&lt;recipient@example.com&gt;\r\n'
reply: '250 2.1.5 &lt;recipient@example.com&gt;... Recipient ok\r\n'
reply: retcode (250); Msg: 2.1.5 &lt;recipient@example.com&gt;... Recipient ok
send: 'data\r\n'
reply: '354 Enter mail, end with "." on a line by itself\r\n'
reply: retcode (354); Msg: Enter mail, end with "." on a line by itself
data: (354, 'Enter mail, end with "." on a line by itself')
send: 'From nobody Sun Sep 28 10:02:48 2008\r\nContent-Type: text/plain; charset="us-ascii"\r\nMIME-Version: 1.0\r\nContent-Transfer-Encoding: 7bit\r\nTo: Recipient &lt;recipient@example.com&gt;\r\nFrom: Author &lt;author@example.com&gt;\r\nSubject: Simple test message\r\n\r\nThis is the body of the message.\r\n.\r\n'
reply: '250 2.0.0 m8SE2mpc015614 Message accepted for delivery\r\n'
reply: retcode (250); Msg: 2.0.0 m8SE2mpc015614 Message accepted for delivery
data: (250, '2.0.0 m8SE2mpc015614 Message accepted for delivery')
send: 'quit\r\n'
reply: '221 2.0.0 mail.example.com closing connection\r\n'
reply: retcode (221); Msg: 2.0.0 mail.example.com closing connection</pre>
</div>
<p>Notice that the second argument to <tt class="docutils literal"><span class="pre">sendmail()</span></tt>, the recipients, is passed as a list.  You can include any number of addresses in the list to have the message delivered to each of them in turn.  Since the envelope information is separate from the message headers, you can even BCC someone by including them in the method argument but not in the message header.</p>
</div>
<div class="section" id="authentication-and-encryption">
<h2>Authentication and Encryption<a class="headerlink" href="#authentication-and-encryption" title="Permalink to this headline">¶</a></h2>
<p>The SMTP class also handles authentication and TLS (transport layer security) encryption, when the server supports them.  To determine if the server supports TLS, call <tt class="docutils literal"><span class="pre">ehlo()</span></tt> directly to identify your computer to the server and ask it what extensions are available.  Then call <tt class="docutils literal"><span class="pre">has_extn()</span></tt> to check the results.  Once TLS is started, you must call <tt class="docutils literal"><span class="pre">ehlo()</span></tt> again before authenticating.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">smtplib</span>
<span class="kn">import</span> <span class="nn">email.utils</span>
<span class="kn">from</span> <span class="nn">email.mime.text</span> <span class="kn">import</span> <span class="n">MIMEText</span>
<span class="kn">import</span> <span class="nn">getpass</span>

<span class="c"># Prompt the user for connection info</span>
<span class="n">to_email</span> <span class="o">=</span> <span class="nb">raw_input</span><span class="p">(</span><span class="s">&#39;Recipient: &#39;</span><span class="p">)</span>
<span class="n">servername</span> <span class="o">=</span> <span class="nb">raw_input</span><span class="p">(</span><span class="s">&#39;Mail server name: &#39;</span><span class="p">)</span>
<span class="n">username</span> <span class="o">=</span> <span class="nb">raw_input</span><span class="p">(</span><span class="s">&#39;Mail user name: &#39;</span><span class="p">)</span>
<span class="n">password</span> <span class="o">=</span> <span class="n">getpass</span><span class="o">.</span><span class="n">getpass</span><span class="p">(</span><span class="s">&quot;</span><span class="si">%s</span><span class="s">&#39;s password: &quot;</span> <span class="o">%</span> <span class="n">username</span><span class="p">)</span>

<span class="c"># Create the message</span>
<span class="n">msg</span> <span class="o">=</span> <span class="n">MIMEText</span><span class="p">(</span><span class="s">&#39;Test message from PyMOTW.&#39;</span><span class="p">)</span>
<span class="n">msg</span><span class="o">.</span><span class="n">set_unixfrom</span><span class="p">(</span><span class="s">&#39;author&#39;</span><span class="p">)</span>
<span class="n">msg</span><span class="p">[</span><span class="s">&#39;To&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">email</span><span class="o">.</span><span class="n">utils</span><span class="o">.</span><span class="n">formataddr</span><span class="p">((</span><span class="s">&#39;Recipient&#39;</span><span class="p">,</span> <span class="n">to_email</span><span class="p">))</span>
<span class="n">msg</span><span class="p">[</span><span class="s">&#39;From&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">email</span><span class="o">.</span><span class="n">utils</span><span class="o">.</span><span class="n">formataddr</span><span class="p">((</span><span class="s">&#39;Author&#39;</span><span class="p">,</span> <span class="s">&#39;author@example.com&#39;</span><span class="p">))</span>
<span class="n">msg</span><span class="p">[</span><span class="s">&#39;Subject&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s">&#39;Test from PyMOTW&#39;</span>

<span class="n">server</span> <span class="o">=</span> <span class="n">smtplib</span><span class="o">.</span><span class="n">SMTP</span><span class="p">(</span><span class="n">servername</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span>
    <span class="n">server</span><span class="o">.</span><span class="n">set_debuglevel</span><span class="p">(</span><span class="bp">True</span><span class="p">)</span>

    <span class="c"># identify ourselves, prompting server for supported features</span>
    <span class="n">server</span><span class="o">.</span><span class="n">ehlo</span><span class="p">()</span>

    <span class="c"># If we can encrypt this session, do it</span>
    <span class="k">if</span> <span class="n">server</span><span class="o">.</span><span class="n">has_extn</span><span class="p">(</span><span class="s">&#39;STARTTLS&#39;</span><span class="p">):</span>
        <span class="n">server</span><span class="o">.</span><span class="n">starttls</span><span class="p">()</span>
        <span class="n">server</span><span class="o">.</span><span class="n">ehlo</span><span class="p">()</span> <span class="c"># re-identify ourselves over TLS connection</span>

    <span class="n">server</span><span class="o">.</span><span class="n">login</span><span class="p">(</span><span class="n">username</span><span class="p">,</span> <span class="n">password</span><span class="p">)</span>
    <span class="n">server</span><span class="o">.</span><span class="n">sendmail</span><span class="p">(</span><span class="s">&#39;author@example.com&#39;</span><span class="p">,</span> <span class="p">[</span><span class="n">to_email</span><span class="p">],</span> <span class="n">msg</span><span class="o">.</span><span class="n">as_string</span><span class="p">())</span>
<span class="k">finally</span><span class="p">:</span>
    <span class="n">server</span><span class="o">.</span><span class="n">quit</span><span class="p">()</span>
</pre></div>
</div>
<p>Notice that <tt class="docutils literal"><span class="pre">STARTTLS</span></tt> does not appear in the list of extensions (in the reply to <tt class="docutils literal"><span class="pre">EHLO</span></tt>) once TLS is enabled.</p>
<div class="highlight-python"><pre>$ python smtplib_authenticated.py
Recipient: recipient@example.com
Mail server name: smtpauth.isp.net
Mail user name: user@isp.net
user@isp.net's password:
send: 'ehlo localhost.local\r\n'
reply: '250-elasmtp-isp.net Hello localhost.local [&lt;your IP here&gt;]\r\n'
reply: '250-SIZE 14680064\r\n'
reply: '250-PIPELINING\r\n'
reply: '250-AUTH PLAIN LOGIN CRAM-MD5\r\n'
reply: '250-STARTTLS\r\n'
reply: '250 HELP\r\n'
reply: retcode (250); Msg: elasmtp-isp.net Hello localhost.local [&lt;your IP here&gt;]
SIZE 14680064
PIPELINING
AUTH PLAIN LOGIN CRAM-MD5
STARTTLS
HELP
send: 'STARTTLS\r\n'
reply: '220 TLS go ahead\r\n'
reply: retcode (220); Msg: TLS go ahead
send: 'ehlo localhost.local\r\n'
reply: '250-elasmtp-isp.net Hello localhost.local [&lt;your IP here&gt;]\r\n'
reply: '250-SIZE 14680064\r\n'
reply: '250-PIPELINING\r\n'
reply: '250-AUTH PLAIN LOGIN CRAM-MD5\r\n'
reply: '250 HELP\r\n'
reply: retcode (250); Msg: elasmtp-isp.net Hello farnsworth.local [&lt;your IP here&gt;]
SIZE 14680064
PIPELINING
AUTH PLAIN LOGIN CRAM-MD5
HELP
send: 'AUTH CRAM-MD5\r\n'
reply: '334 PDExNjkyLjEyMjI2MTI1NzlAZWxhc210cC1tZWFseS5hdGwuc2EuZWFydGhsaW5rLm5ldD4=\r\n'
reply: retcode (334); Msg: PDExNjkyLjEyMjI2MTI1NzlAZWxhc210cC1tZWFseS5hdGwuc2EuZWFydGhsaW5rLm5ldD4=
send: 'ZGhlbGxtYW5uQGVhcnRobGluay5uZXQgN2Q1YjAyYTRmMGQ1YzZjM2NjOTNjZDc1MDQxN2ViYjg=\r\n'
reply: '235 Authentication succeeded\r\n'
reply: retcode (235); Msg: Authentication succeeded
send: 'mail FROM:&lt;author@example.com&gt; size=221\r\n'
reply: '250 OK\r\n'
reply: retcode (250); Msg: OK
send: 'rcpt TO:&lt;recipient@example.com&gt;\r\n'
reply: '250 Accepted\r\n'
reply: retcode (250); Msg: Accepted
send: 'data\r\n'
reply: '354 Enter message, ending with "." on a line by itself\r\n'
reply: retcode (354); Msg: Enter message, ending with "." on a line by itself
data: (354, 'Enter message, ending with "." on a line by itself')
send: 'Content-Type: text/plain; charset="us-ascii"\r\nMIME-Version: 1.0\r\nContent-Transfer-Encoding: 7bit\r\nTo: Recipient &lt;recipient@example.com&gt;\r\nFrom: Author &lt;author@example.com&gt;\r\nSubject: Test from PyMOTW\r\n\r\nTest message from PyMOTW.\r\n.\r\n'
reply: '250 OK id=1KjxNj-00032a-Ux\r\n'
reply: retcode (250); Msg: OK id=1KjxNj-00032a-Ux
data: (250, 'OK id=1KjxNj-00032a-Ux')
send: 'quit\r\n'
reply: '221 elasmtp-isp.net closing connection\r\n'
reply: retcode (221); Msg: elasmtp-isp.net closing connection</pre>
</div>
</div>
<div class="section" id="verifying-an-email-address">
<h2>Verifying an Email Address<a class="headerlink" href="#verifying-an-email-address" title="Permalink to this headline">¶</a></h2>
<p>The SMTP protocol includes a command to ask a server whether an address is valid.  Usually <tt class="docutils literal"><span class="pre">VRFY</span></tt> is disabled to prevent spammers from finding legitimate email addresses, but if it is enabled you can ask the server about an address and receive a status code indicating validity along with the user&#8217;s full name, if it is available.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">smtplib</span>

<span class="n">server</span> <span class="o">=</span> <span class="n">smtplib</span><span class="o">.</span><span class="n">SMTP</span><span class="p">(</span><span class="s">&#39;mail&#39;</span><span class="p">)</span>
<span class="n">server</span><span class="o">.</span><span class="n">set_debuglevel</span><span class="p">(</span><span class="bp">True</span><span class="p">)</span> <span class="c"># show communication with the server</span>
<span class="k">try</span><span class="p">:</span>
    <span class="n">dhellmann_result</span> <span class="o">=</span> <span class="n">server</span><span class="o">.</span><span class="n">verify</span><span class="p">(</span><span class="s">&#39;dhellmann&#39;</span><span class="p">)</span>
    <span class="n">notthere_result</span> <span class="o">=</span> <span class="n">server</span><span class="o">.</span><span class="n">verify</span><span class="p">(</span><span class="s">&#39;notthere&#39;</span><span class="p">)</span>
<span class="k">finally</span><span class="p">:</span>
    <span class="n">server</span><span class="o">.</span><span class="n">quit</span><span class="p">()</span>

<span class="k">print</span> <span class="s">&#39;dhellmann:&#39;</span><span class="p">,</span> <span class="n">dhellmann_result</span>
<span class="k">print</span> <span class="s">&#39;notthere :&#39;</span><span class="p">,</span> <span class="n">notthere_result</span>
</pre></div>
</div>
<p>As the last 2 lines of output here show, the address <tt class="docutils literal"><span class="pre">dhellmann</span></tt> is valid but <tt class="docutils literal"><span class="pre">notthere</span></tt> is not.</p>
<div class="highlight-python"><pre>$ python smtplib_verify.py
send: 'vrfy &lt;dhellmann&gt;\r\n'
reply: '250 2.1.5 Doug Hellmann &lt;dhellmann@mail.example.com&gt;\r\n'
reply: retcode (250); Msg: 2.1.5 Doug Hellmann &lt;dhellmann@mail.example.com&gt;
send: 'vrfy &lt;notthere&gt;\r\n'
reply: '550 5.1.1 &lt;notthere&gt;... User unknown\r\n'
reply: retcode (550); Msg: 5.1.1 &lt;notthere&gt;... User unknown
send: 'quit\r\n'
reply: '221 2.0.0 mail.example.com closing connection\r\n'
reply: retcode (221); Msg: 2.0.0 mail.example.com closing connection
dhellmann: (250, '2.1.5 Doug Hellmann &lt;dhellmann@mail.example.com&gt;')
notthere : (550, '5.1.1 &lt;notthere&gt;... User unknown')</pre>
</div>
<div class="admonition-see-also admonition seealso">
<p class="first admonition-title">See also</p>
<dl class="last docutils">
<dt><a class="reference external" href="http://docs.python.org/lib/module-smtplib.html">smtplib</a></dt>
<dd>Standard library documentation for this module.</dd>
<dt><span class="target" id="index-1"></span><a class="rfc reference external" href="http://tools.ietf.org/html/rfc821.html"><strong>RFC 821</strong></a></dt>
<dd>The Simple Mail Transfer Protocol (SMTP) specification.</dd>
<dt><span class="target" id="index-2"></span><a class="rfc reference external" href="http://tools.ietf.org/html/rfc1869.html"><strong>RFC 1869</strong></a></dt>
<dd>SMTP Service Extensions to the base protocol.</dd>
<dt><span class="target" id="index-3"></span><a class="rfc reference external" href="http://tools.ietf.org/html/rfc822.html"><strong>RFC 822</strong></a></dt>
<dd>&#8220;Standard for the Format of ARPA Internet Text Messages&#8221;, the original email message
format specification.</dd>
<dt><span class="target" id="index-4"></span><a class="rfc reference external" href="http://tools.ietf.org/html/rfc2822.html"><strong>RFC 2822</strong></a></dt>
<dd>&#8220;Internet Message Format&#8221;, updates to the email message format.</dd>
<dt><tt class="xref py py-mod docutils literal"><span class="pre">email</span></tt></dt>
<dd>Standard library module for parsing email messages.</dd>
<dt><a class="reference internal" href="../smtpd/index.html#module-smtpd" title="smtpd: Includes classes for implementing SMTP servers."><tt class="xref py py-mod docutils literal"><span class="pre">smtpd</span></tt></a></dt>
<dd>Implements a simple SMTP server.</dd>
</dl>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="../socket/index.html" title="socket – Network Communication"
             >next</a> |</li>
        <li class="right" >
          <a href="../smtpd/index.html" title="smtpd – Sample SMTP Servers"
             >previous</a> |</li>
        <li><a href="../contents.html">PyMOTW</a> &raquo;</li>
          <li><a href="../internet_protocols.html" >Internet Protocols and Support</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
      &copy; Copyright Doug Hellmann.
      Last updated on Oct 24, 2010.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.

    <br/><a href="http://creativecommons.org/licenses/by-nc-sa/3.0/us/" rel="license"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-sa/3.0/us/88x31.png"/></a>
    
    </div>
  </body>
</html>

[top] / python / PyMOTW / docs / smtplib / index.html

contact | logmethods.com