You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

442 lines
34 KiB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title>email_lib Package &mdash; WNFramework v1.8 documentation</title>
  7. <link rel="stylesheet" href="_static/default.css" type="text/css" />
  8. <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
  9. <script type="text/javascript">
  10. var DOCUMENTATION_OPTIONS = {
  11. URL_ROOT: '',
  12. VERSION: '1.8',
  13. COLLAPSE_INDEX: false,
  14. FILE_SUFFIX: '.html',
  15. HAS_SOURCE: true
  16. };
  17. </script>
  18. <script type="text/javascript" src="_static/jquery.js"></script>
  19. <script type="text/javascript" src="_static/underscore.js"></script>
  20. <script type="text/javascript" src="_static/doctools.js"></script>
  21. <link rel="top" title="WNFramework v1.8 documentation" href="index.html" />
  22. </head>
  23. <body>
  24. <div class="related">
  25. <h3>Navigation</h3>
  26. <ul>
  27. <li class="right" style="margin-right: 10px">
  28. <a href="genindex.html" title="General Index"
  29. accesskey="I">index</a></li>
  30. <li class="right" >
  31. <a href="py-modindex.html" title="Python Module Index"
  32. >modules</a> |</li>
  33. <li><a href="index.html">WNFramework v1.8 documentation</a> &raquo;</li>
  34. </ul>
  35. </div>
  36. <div class="document">
  37. <div class="documentwrapper">
  38. <div class="bodywrapper">
  39. <div class="body">
  40. <div class="section" id="email-lib-package">
  41. <h1>email_lib Package<a class="headerlink" href="#email-lib-package" title="Permalink to this headline">¶</a></h1>
  42. <div class="section" id="id1">
  43. <h2><tt class="xref py py-mod docutils literal"><span class="pre">email_lib</span></tt> Package<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2>
  44. <span class="target" id="module-webnotes.utils.email_lib"></span><dl class="function">
  45. <dt id="webnotes.utils.email_lib.get_contact_list">
  46. <tt class="descclassname">webnotes.utils.email_lib.</tt><tt class="descname">get_contact_list</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib.html#get_contact_list"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.get_contact_list" title="Permalink to this definition">¶</a></dt>
  47. <dd><p>Returns contacts (from autosuggest)</p>
  48. </dd></dl>
  49. <dl class="function">
  50. <dt id="webnotes.utils.email_lib.get_footer">
  51. <tt class="descclassname">webnotes.utils.email_lib.</tt><tt class="descname">get_footer</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib.html#get_footer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.get_footer" title="Permalink to this definition">¶</a></dt>
  52. <dd><p>Returns combination of footer from globals and Control Panel</p>
  53. </dd></dl>
  54. <dl class="function">
  55. <dt id="webnotes.utils.email_lib.make_html_body">
  56. <tt class="descclassname">webnotes.utils.email_lib.</tt><tt class="descname">make_html_body</tt><big>(</big><em>content</em>, <em>template=None</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib.html#make_html_body"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.make_html_body" title="Permalink to this definition">¶</a></dt>
  57. <dd><p>Generate html content from a Page Template object</p>
  58. </dd></dl>
  59. <dl class="function">
  60. <dt id="webnotes.utils.email_lib.send_form">
  61. <tt class="descclassname">webnotes.utils.email_lib.</tt><tt class="descname">send_form</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib.html#send_form"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.send_form" title="Permalink to this definition">¶</a></dt>
  62. <dd><p>Emails a print format (form)
  63. Called from form UI</p>
  64. </dd></dl>
  65. <dl class="function">
  66. <dt id="webnotes.utils.email_lib.sendmail">
  67. <tt class="descclassname">webnotes.utils.email_lib.</tt><tt class="descname">sendmail</tt><big>(</big><em>recipients</em>, <em>sender=''</em>, <em>msg=''</em>, <em>subject='[No Subject]'</em>, <em>parts=</em><span class="optional">[</span><span class="optional">]</span>, <em>cc=</em><span class="optional">[</span><span class="optional">]</span>, <em>attach=</em><span class="optional">[</span><span class="optional">]</span>, <em>send_now=1</em>, <em>reply_to=None</em>, <em>template=None</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib.html#sendmail"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.sendmail" title="Permalink to this definition">¶</a></dt>
  68. <dd><p>send an html email as multipart with attachments and all</p>
  69. </dd></dl>
  70. <dl class="function">
  71. <dt id="webnotes.utils.email_lib.sendmail_html">
  72. <tt class="descclassname">webnotes.utils.email_lib.</tt><tt class="descname">sendmail_html</tt><big>(</big><em>sender</em>, <em>recipients</em>, <em>subject</em>, <em>html</em>, <em>text=None</em>, <em>template=None</em>, <em>send_now=1</em>, <em>reply_to=None</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib.html#sendmail_html"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.sendmail_html" title="Permalink to this definition">¶</a></dt>
  73. <dd><p>Send an html mail with alternative text and using Page Templates</p>
  74. </dd></dl>
  75. </div>
  76. <div class="section" id="module-webnotes.utils.email_lib.form_email">
  77. <span id="form-email-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">form_email</span></tt> Module<a class="headerlink" href="#module-webnotes.utils.email_lib.form_email" title="Permalink to this headline">¶</a></h2>
  78. <dl class="class">
  79. <dt id="webnotes.utils.email_lib.form_email.FormEmail">
  80. <em class="property">class </em><tt class="descclassname">webnotes.utils.email_lib.form_email.</tt><tt class="descname">FormEmail</tt><a class="reference internal" href="_modules/webnotes/utils/email_lib/form_email.html#FormEmail"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.form_email.FormEmail" title="Permalink to this definition">¶</a></dt>
  81. <dd><p>Represents an email sent from a Form</p>
  82. <dl class="method">
  83. <dt id="webnotes.utils.email_lib.form_email.FormEmail.build_message">
  84. <tt class="descname">build_message</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/form_email.html#FormEmail.build_message"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.form_email.FormEmail.build_message" title="Permalink to this definition">¶</a></dt>
  85. <dd><p>Builds the message object</p>
  86. </dd></dl>
  87. <dl class="method">
  88. <dt id="webnotes.utils.email_lib.form_email.FormEmail.get_form_link">
  89. <tt class="descname">get_form_link</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/form_email.html#FormEmail.get_form_link"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.form_email.FormEmail.get_form_link" title="Permalink to this definition">¶</a></dt>
  90. <dd><p>Returns publicly accessible form link</p>
  91. </dd></dl>
  92. <dl class="method">
  93. <dt id="webnotes.utils.email_lib.form_email.FormEmail.make_full_links">
  94. <tt class="descname">make_full_links</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/form_email.html#FormEmail.make_full_links"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.form_email.FormEmail.make_full_links" title="Permalink to this definition">¶</a></dt>
  95. <dd><p>Adds server name the relative links, so that images etc can be seen correctly</p>
  96. </dd></dl>
  97. <dl class="method">
  98. <dt id="webnotes.utils.email_lib.form_email.FormEmail.send">
  99. <tt class="descname">send</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/form_email.html#FormEmail.send"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.form_email.FormEmail.send" title="Permalink to this definition">¶</a></dt>
  100. <dd><p>Send the form with html attachment</p>
  101. </dd></dl>
  102. <dl class="method">
  103. <dt id="webnotes.utils.email_lib.form_email.FormEmail.set_attachments">
  104. <tt class="descname">set_attachments</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/form_email.html#FormEmail.set_attachments"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.form_email.FormEmail.set_attachments" title="Permalink to this definition">¶</a></dt>
  105. <dd><p>Set attachments to the email from the form</p>
  106. </dd></dl>
  107. <dl class="method">
  108. <dt id="webnotes.utils.email_lib.form_email.FormEmail.update_contacts">
  109. <tt class="descname">update_contacts</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/form_email.html#FormEmail.update_contacts"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.form_email.FormEmail.update_contacts" title="Permalink to this definition">¶</a></dt>
  110. <dd><p>Add new email contact to database</p>
  111. </dd></dl>
  112. </dd></dl>
  113. </div>
  114. <div class="section" id="module-webnotes.utils.email_lib.html2text">
  115. <span id="html2text-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">html2text</span></tt> Module<a class="headerlink" href="#module-webnotes.utils.email_lib.html2text" title="Permalink to this headline">¶</a></h2>
  116. <p>html2text: Turn HTML into equivalent Markdown-structured text.</p>
  117. <dl class="function">
  118. <dt id="webnotes.utils.email_lib.html2text.charref">
  119. <tt class="descclassname">webnotes.utils.email_lib.html2text.</tt><tt class="descname">charref</tt><big>(</big><em>name</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/html2text.html#charref"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.html2text.charref" title="Permalink to this definition">¶</a></dt>
  120. <dd></dd></dl>
  121. <dl class="function">
  122. <dt id="webnotes.utils.email_lib.html2text.entityref">
  123. <tt class="descclassname">webnotes.utils.email_lib.html2text.</tt><tt class="descname">entityref</tt><big>(</big><em>c</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/html2text.html#entityref"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.html2text.entityref" title="Permalink to this definition">¶</a></dt>
  124. <dd></dd></dl>
  125. <dl class="function">
  126. <dt id="webnotes.utils.email_lib.html2text.has_key">
  127. <tt class="descclassname">webnotes.utils.email_lib.html2text.</tt><tt class="descname">has_key</tt><big>(</big><em>x</em>, <em>y</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/html2text.html#has_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.html2text.has_key" title="Permalink to this definition">¶</a></dt>
  128. <dd></dd></dl>
  129. <dl class="function">
  130. <dt id="webnotes.utils.email_lib.html2text.hn">
  131. <tt class="descclassname">webnotes.utils.email_lib.html2text.</tt><tt class="descname">hn</tt><big>(</big><em>tag</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/html2text.html#hn"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.html2text.hn" title="Permalink to this definition">¶</a></dt>
  132. <dd></dd></dl>
  133. <dl class="function">
  134. <dt id="webnotes.utils.email_lib.html2text.html2text">
  135. <tt class="descclassname">webnotes.utils.email_lib.html2text.</tt><tt class="descname">html2text</tt><big>(</big><em>html</em>, <em>baseurl=''</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/html2text.html#html2text"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.html2text.html2text" title="Permalink to this definition">¶</a></dt>
  136. <dd></dd></dl>
  137. <dl class="function">
  138. <dt id="webnotes.utils.email_lib.html2text.html2text_file">
  139. <tt class="descclassname">webnotes.utils.email_lib.html2text.</tt><tt class="descname">html2text_file</tt><big>(</big><em>html</em>, <em>out=&lt;function wrapwrite at 0x38ff030&gt;</em>, <em>baseurl=''</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/html2text.html#html2text_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.html2text.html2text_file" title="Permalink to this definition">¶</a></dt>
  140. <dd></dd></dl>
  141. <dl class="function">
  142. <dt id="webnotes.utils.email_lib.html2text.name2cp">
  143. <tt class="descclassname">webnotes.utils.email_lib.html2text.</tt><tt class="descname">name2cp</tt><big>(</big><em>k</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/html2text.html#name2cp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.html2text.name2cp" title="Permalink to this definition">¶</a></dt>
  144. <dd></dd></dl>
  145. <dl class="function">
  146. <dt id="webnotes.utils.email_lib.html2text.onlywhite">
  147. <tt class="descclassname">webnotes.utils.email_lib.html2text.</tt><tt class="descname">onlywhite</tt><big>(</big><em>line</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/html2text.html#onlywhite"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.html2text.onlywhite" title="Permalink to this definition">¶</a></dt>
  148. <dd><p>Return true if the line does only consist of whitespace characters.</p>
  149. </dd></dl>
  150. <dl class="function">
  151. <dt id="webnotes.utils.email_lib.html2text.optwrap">
  152. <tt class="descclassname">webnotes.utils.email_lib.html2text.</tt><tt class="descname">optwrap</tt><big>(</big><em>text</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/html2text.html#optwrap"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.html2text.optwrap" title="Permalink to this definition">¶</a></dt>
  153. <dd><p>Wrap all paragraphs in the provided text.</p>
  154. </dd></dl>
  155. <dl class="function">
  156. <dt id="webnotes.utils.email_lib.html2text.replaceEntities">
  157. <tt class="descclassname">webnotes.utils.email_lib.html2text.</tt><tt class="descname">replaceEntities</tt><big>(</big><em>s</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/html2text.html#replaceEntities"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.html2text.replaceEntities" title="Permalink to this definition">¶</a></dt>
  158. <dd></dd></dl>
  159. <dl class="function">
  160. <dt id="webnotes.utils.email_lib.html2text.unescape">
  161. <tt class="descclassname">webnotes.utils.email_lib.html2text.</tt><tt class="descname">unescape</tt><big>(</big><em>s</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/html2text.html#unescape"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.html2text.unescape" title="Permalink to this definition">¶</a></dt>
  162. <dd></dd></dl>
  163. <dl class="function">
  164. <dt id="webnotes.utils.email_lib.html2text.wrapwrite">
  165. <tt class="descclassname">webnotes.utils.email_lib.html2text.</tt><tt class="descname">wrapwrite</tt><big>(</big><em>text</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/html2text.html#wrapwrite"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.html2text.wrapwrite" title="Permalink to this definition">¶</a></dt>
  166. <dd></dd></dl>
  167. </div>
  168. <div class="section" id="module-webnotes.utils.email_lib.receive">
  169. <span id="receive-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">receive</span></tt> Module<a class="headerlink" href="#module-webnotes.utils.email_lib.receive" title="Permalink to this headline">¶</a></h2>
  170. <p>This module contains classes for managing incoming emails</p>
  171. <dl class="class">
  172. <dt id="webnotes.utils.email_lib.receive.IncomingMail">
  173. <em class="property">class </em><tt class="descclassname">webnotes.utils.email_lib.receive.</tt><tt class="descname">IncomingMail</tt><big>(</big><em>content</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/receive.html#IncomingMail"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.receive.IncomingMail" title="Permalink to this definition">¶</a></dt>
  174. <dd><p>Single incoming email object. Extracts, text / html and attachments from the email</p>
  175. <dl class="method">
  176. <dt id="webnotes.utils.email_lib.receive.IncomingMail.get_attachment">
  177. <tt class="descname">get_attachment</tt><big>(</big><em>part</em>, <em>charset</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/receive.html#IncomingMail.get_attachment"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.receive.IncomingMail.get_attachment" title="Permalink to this definition">¶</a></dt>
  178. <dd><p>Extracts an attachment</p>
  179. </dd></dl>
  180. <dl class="method">
  181. <dt id="webnotes.utils.email_lib.receive.IncomingMail.get_charset">
  182. <tt class="descname">get_charset</tt><big>(</big><em>part</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/receive.html#IncomingMail.get_charset"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.receive.IncomingMail.get_charset" title="Permalink to this definition">¶</a></dt>
  183. <dd><p>Guesses character set</p>
  184. </dd></dl>
  185. <dl class="method">
  186. <dt id="webnotes.utils.email_lib.receive.IncomingMail.get_payload">
  187. <tt class="descname">get_payload</tt><big>(</big><em>part</em>, <em>charset</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/receive.html#IncomingMail.get_payload"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.receive.IncomingMail.get_payload" title="Permalink to this definition">¶</a></dt>
  188. <dd><p>get utf-8 encoded part content</p>
  189. </dd></dl>
  190. <dl class="method">
  191. <dt id="webnotes.utils.email_lib.receive.IncomingMail.get_text_content">
  192. <tt class="descname">get_text_content</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/receive.html#IncomingMail.get_text_content"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.receive.IncomingMail.get_text_content" title="Permalink to this definition">¶</a></dt>
  193. <dd><p>Returns the text parts of the email. If None, then HTML parts</p>
  194. </dd></dl>
  195. <dl class="method">
  196. <dt id="webnotes.utils.email_lib.receive.IncomingMail.get_thread_id">
  197. <tt class="descname">get_thread_id</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/receive.html#IncomingMail.get_thread_id"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.receive.IncomingMail.get_thread_id" title="Permalink to this definition">¶</a></dt>
  198. <dd><p>Extracts thread id of the message between first []
  199. from the subject</p>
  200. </dd></dl>
  201. <dl class="method">
  202. <dt id="webnotes.utils.email_lib.receive.IncomingMail.parse">
  203. <tt class="descname">parse</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/receive.html#IncomingMail.parse"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.receive.IncomingMail.parse" title="Permalink to this definition">¶</a></dt>
  204. <dd><p>Extracts text, html and attachments from the mail</p>
  205. </dd></dl>
  206. <dl class="method">
  207. <dt id="webnotes.utils.email_lib.receive.IncomingMail.process_part">
  208. <tt class="descname">process_part</tt><big>(</big><em>part</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/receive.html#IncomingMail.process_part"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.receive.IncomingMail.process_part" title="Permalink to this definition">¶</a></dt>
  209. <dd><p>Process a single part of an email</p>
  210. </dd></dl>
  211. </dd></dl>
  212. <dl class="class">
  213. <dt id="webnotes.utils.email_lib.receive.POP3Mailbox">
  214. <em class="property">class </em><tt class="descclassname">webnotes.utils.email_lib.receive.</tt><tt class="descname">POP3Mailbox</tt><big>(</big><em>settings_doc</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/receive.html#POP3Mailbox"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.receive.POP3Mailbox" title="Permalink to this definition">¶</a></dt>
  215. <dd><p>A simple pop3 mailbox, abstracts connection and mail extraction
  216. To use, subclass it and override method process_message(from, subject, text, thread_id)</p>
  217. <dl class="method">
  218. <dt id="webnotes.utils.email_lib.receive.POP3Mailbox.check_mails">
  219. <tt class="descname">check_mails</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/receive.html#POP3Mailbox.check_mails"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.receive.POP3Mailbox.check_mails" title="Permalink to this definition">¶</a></dt>
  220. <dd><p>To be overridden
  221. If mailbox is to be scanned, returns true</p>
  222. </dd></dl>
  223. <dl class="method">
  224. <dt id="webnotes.utils.email_lib.receive.POP3Mailbox.connect">
  225. <tt class="descname">connect</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/receive.html#POP3Mailbox.connect"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.receive.POP3Mailbox.connect" title="Permalink to this definition">¶</a></dt>
  226. <dd><p>Connects to the mailbox</p>
  227. </dd></dl>
  228. <dl class="method">
  229. <dt id="webnotes.utils.email_lib.receive.POP3Mailbox.get_messages">
  230. <tt class="descname">get_messages</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/receive.html#POP3Mailbox.get_messages"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.receive.POP3Mailbox.get_messages" title="Permalink to this definition">¶</a></dt>
  231. <dd><p>Loads messages from the mailbox and calls
  232. process_message for each message</p>
  233. </dd></dl>
  234. <dl class="method">
  235. <dt id="webnotes.utils.email_lib.receive.POP3Mailbox.process_message">
  236. <tt class="descname">process_message</tt><big>(</big><em>mail</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/receive.html#POP3Mailbox.process_message"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.receive.POP3Mailbox.process_message" title="Permalink to this definition">¶</a></dt>
  237. <dd><p>To be overriden</p>
  238. </dd></dl>
  239. </dd></dl>
  240. </div>
  241. <div class="section" id="module-webnotes.utils.email_lib.send">
  242. <span id="send-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">send</span></tt> Module<a class="headerlink" href="#module-webnotes.utils.email_lib.send" title="Permalink to this headline">¶</a></h2>
  243. <p>Sends email via outgoing server specified in &#8220;Control Panel&#8221;
  244. Allows easy adding of Attachments of &#8220;File&#8221; objects</p>
  245. <dl class="class">
  246. <dt id="webnotes.utils.email_lib.send.EMail">
  247. <em class="property">class </em><tt class="descclassname">webnotes.utils.email_lib.send.</tt><tt class="descname">EMail</tt><big>(</big><em>sender=''</em>, <em>recipients=</em><span class="optional">[</span><span class="optional">]</span>, <em>subject=''</em>, <em>from_defs=0</em>, <em>alternative=0</em>, <em>reply_to=None</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/send.html#EMail"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.send.EMail" title="Permalink to this definition">¶</a></dt>
  248. <dd><p>Wrapper on the email module. Email object represents emails to be sent to the client.
  249. Also provides a clean way to add binary <cite>FileData</cite> attachments
  250. Also sets all messages as multipart/alternative for cleaner reading in text-only clients</p>
  251. <dl class="method">
  252. <dt id="webnotes.utils.email_lib.send.EMail.add_attachment">
  253. <tt class="descname">add_attachment</tt><big>(</big><em>fname</em>, <em>fcontent</em>, <em>content_type=None</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/send.html#EMail.add_attachment"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.send.EMail.add_attachment" title="Permalink to this definition">¶</a></dt>
  254. <dd></dd></dl>
  255. <dl class="method">
  256. <dt id="webnotes.utils.email_lib.send.EMail.add_to_queue">
  257. <tt class="descname">add_to_queue</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/send.html#EMail.add_to_queue"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.send.EMail.add_to_queue" title="Permalink to this definition">¶</a></dt>
  258. <dd></dd></dl>
  259. <dl class="method">
  260. <dt id="webnotes.utils.email_lib.send.EMail.attach_file">
  261. <tt class="descname">attach_file</tt><big>(</big><em>n</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/send.html#EMail.attach_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.send.EMail.attach_file" title="Permalink to this definition">¶</a></dt>
  262. <dd><p>attach a file from the <cite>FileData</cite> table</p>
  263. </dd></dl>
  264. <dl class="method">
  265. <dt id="webnotes.utils.email_lib.send.EMail.make_msg">
  266. <tt class="descname">make_msg</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/send.html#EMail.make_msg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.send.EMail.make_msg" title="Permalink to this definition">¶</a></dt>
  267. <dd></dd></dl>
  268. <dl class="method">
  269. <dt id="webnotes.utils.email_lib.send.EMail.send">
  270. <tt class="descname">send</tt><big>(</big><em>send_now=0</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/send.html#EMail.send"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.send.EMail.send" title="Permalink to this definition">¶</a></dt>
  271. <dd><p>send the message</p>
  272. </dd></dl>
  273. <dl class="method">
  274. <dt id="webnotes.utils.email_lib.send.EMail.set_html">
  275. <tt class="descname">set_html</tt><big>(</big><em>message</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/send.html#EMail.set_html"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.send.EMail.set_html" title="Permalink to this definition">¶</a></dt>
  276. <dd><p>Attach message in the html portion of multipart/alternative</p>
  277. </dd></dl>
  278. <dl class="method">
  279. <dt id="webnotes.utils.email_lib.send.EMail.set_message">
  280. <tt class="descname">set_message</tt><big>(</big><em>message</em>, <em>mime_type='text/html'</em>, <em>as_attachment=0</em>, <em>filename='attachment.html'</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/send.html#EMail.set_message"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.send.EMail.set_message" title="Permalink to this definition">¶</a></dt>
  281. <dd><p>Append the message with MIME content to the root node (as attachment)</p>
  282. </dd></dl>
  283. <dl class="method">
  284. <dt id="webnotes.utils.email_lib.send.EMail.set_text">
  285. <tt class="descname">set_text</tt><big>(</big><em>message</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/send.html#EMail.set_text"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.send.EMail.set_text" title="Permalink to this definition">¶</a></dt>
  286. <dd><p>Attach message in the text portion of multipart/alternative</p>
  287. </dd></dl>
  288. <dl class="method">
  289. <dt id="webnotes.utils.email_lib.send.EMail.setup">
  290. <tt class="descname">setup</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/send.html#EMail.setup"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.send.EMail.setup" title="Permalink to this definition">¶</a></dt>
  291. <dd><p>setup the SMTP (outgoing) server from <cite>Control Panel</cite> or defs.py</p>
  292. </dd></dl>
  293. <dl class="method">
  294. <dt id="webnotes.utils.email_lib.send.EMail.validate">
  295. <tt class="descname">validate</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/send.html#EMail.validate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.send.EMail.validate" title="Permalink to this definition">¶</a></dt>
  296. <dd><p>validate the email ids</p>
  297. </dd></dl>
  298. </dd></dl>
  299. <dl class="class">
  300. <dt id="webnotes.utils.email_lib.send.EmailQueue">
  301. <em class="property">class </em><tt class="descclassname">webnotes.utils.email_lib.send.</tt><tt class="descname">EmailQueue</tt><a class="reference internal" href="_modules/webnotes/utils/email_lib/send.html#EmailQueue"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.send.EmailQueue" title="Permalink to this definition">¶</a></dt>
  302. <dd><dl class="method">
  303. <dt id="webnotes.utils.email_lib.send.EmailQueue.close">
  304. <tt class="descname">close</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/send.html#EmailQueue.close"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.send.EmailQueue.close" title="Permalink to this definition">¶</a></dt>
  305. <dd></dd></dl>
  306. <dl class="method">
  307. <dt id="webnotes.utils.email_lib.send.EmailQueue.flush">
  308. <tt class="descname">flush</tt><big>(</big><em>qty=100</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/send.html#EmailQueue.flush"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.send.EmailQueue.flush" title="Permalink to this definition">¶</a></dt>
  309. <dd></dd></dl>
  310. <dl class="method">
  311. <dt id="webnotes.utils.email_lib.send.EmailQueue.get_smtp_session">
  312. <tt class="descname">get_smtp_session</tt><big>(</big><em>e</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/send.html#EmailQueue.get_smtp_session"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.send.EmailQueue.get_smtp_session" title="Permalink to this definition">¶</a></dt>
  313. <dd></dd></dl>
  314. <dl class="method">
  315. <dt id="webnotes.utils.email_lib.send.EmailQueue.push">
  316. <tt class="descname">push</tt><big>(</big><em>email</em><big>)</big><a class="reference internal" href="_modules/webnotes/utils/email_lib/send.html#EmailQueue.push"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#webnotes.utils.email_lib.send.EmailQueue.push" title="Permalink to this definition">¶</a></dt>
  317. <dd></dd></dl>
  318. </dd></dl>
  319. </div>
  320. </div>
  321. </div>
  322. </div>
  323. </div>
  324. <div class="sphinxsidebar">
  325. <div class="sphinxsidebarwrapper">
  326. <p class="logo"><a href="index.html">
  327. <img class="logo" src="_static/wnflogo200.gif" alt="Logo"/>
  328. </a></p>
  329. <h3><a href="index.html">Table Of Contents</a></h3>
  330. <ul>
  331. <li><a class="reference internal" href="#">email_lib Package</a><ul>
  332. <li><a class="reference internal" href="#id1"><tt class="docutils literal"><span class="pre">email_lib</span></tt> Package</a></li>
  333. <li><a class="reference internal" href="#module-webnotes.utils.email_lib.form_email"><tt class="docutils literal"><span class="pre">form_email</span></tt> Module</a></li>
  334. <li><a class="reference internal" href="#module-webnotes.utils.email_lib.html2text"><tt class="docutils literal"><span class="pre">html2text</span></tt> Module</a></li>
  335. <li><a class="reference internal" href="#module-webnotes.utils.email_lib.receive"><tt class="docutils literal"><span class="pre">receive</span></tt> Module</a></li>
  336. <li><a class="reference internal" href="#module-webnotes.utils.email_lib.send"><tt class="docutils literal"><span class="pre">send</span></tt> Module</a></li>
  337. </ul>
  338. </li>
  339. </ul>
  340. <h3>This Page</h3>
  341. <ul class="this-page-menu">
  342. <li><a href="_sources/webnotes.utils.email_lib.txt"
  343. rel="nofollow">Show Source</a></li>
  344. </ul>
  345. <div id="searchbox" style="display: none">
  346. <h3>Quick search</h3>
  347. <form class="search" action="search.html" method="get">
  348. <input type="text" name="q" size="18" />
  349. <input type="submit" value="Go" />
  350. <input type="hidden" name="check_keywords" value="yes" />
  351. <input type="hidden" name="area" value="default" />
  352. </form>
  353. <p class="searchtip" style="font-size: 90%">
  354. Enter search terms or a module, class or function name.
  355. </p>
  356. </div>
  357. <script type="text/javascript">$('#searchbox').show(0);</script>
  358. </div>
  359. </div>
  360. <div class="clearer"></div>
  361. </div>
  362. <div class="related">
  363. <h3>Navigation</h3>
  364. <ul>
  365. <li class="right" style="margin-right: 10px">
  366. <a href="genindex.html" title="General Index"
  367. >index</a></li>
  368. <li class="right" >
  369. <a href="py-modindex.html" title="Python Module Index"
  370. >modules</a> |</li>
  371. <li><a href="index.html">WNFramework v1.8 documentation</a> &raquo;</li>
  372. </ul>
  373. </div>
  374. <div class="footer">
  375. &copy; Copyright 2011, Rushabh Mehta, Web Notes Technologies.
  376. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
  377. </div>
  378. </body>
  379. </html>