⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 classprfc822channel.html

📁 pwlib开发文档
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>PRFC822Channel class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.18 --><center><a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center><hr><h1>PRFC822Channel Class Reference</h1><code>#include &lt;<a class="el" href="inetmail_8h-source.html">inetmail.h</a>&gt;</code><p><p>Inheritance diagram for PRFC822Channel:<p><center><img src="classPRFC822Channel.png" usemap="#PRFC822Channel_map" border="0" alt=""></center><map name="PRFC822Channel_map"><area href="classPIndirectChannel.html" alt="PIndirectChannel" shape="rect" coords="0,112,113,136"><area href="classPChannel.html" alt="PChannel" shape="rect" coords="0,56,113,80"><area href="classPObject.html" alt="PObject" shape="rect" coords="0,0,113,24"></map><a href="classPRFC822Channel-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0><tr><td></td></tr><tr><td colspan=2><br><h2>Public Types</h2></td></tr><tr><td nowrap align=right valign=top>enum &nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#s2">Direction</a> { <a class="el" href="classPRFC822Channel.html#s2s0">Sending</a>, <a class="el" href="classPRFC822Channel.html#s2s1">Receiving</a> }</td></tr><tr><td colspan=2><br><h2>Public Methods</h2></td></tr><tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#a0">PRFC822Channel</a> (<a class="el" href="classPRFC822Channel.html#s2">Direction</a> direction)</td></tr><tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#a1">~PRFC822Channel</a> ()</td></tr><tr><td nowrap align=right valign=top>BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#a2">Close</a> ()</td></tr><tr><td nowrap align=right valign=top>virtual BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#a3">Write</a> (const void *buf, PINDEX len)</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#a4">NewMessage</a> (<a class="el" href="classPRFC822Channel.html#s2">Direction</a> direction)</td></tr><tr><td nowrap align=right valign=top><a class="el" href="classPString.html">PString</a>&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#a5">MultipartMessage</a> ()</td></tr><tr><td nowrap align=right valign=top>BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#a6">MultipartMessage</a> (const <a class="el" href="classPString.html">PString</a> &amp;boundary)</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#a7">NextPart</a> (const <a class="el" href="classPString.html">PString</a> &amp;boundary)</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#a8">SetFromAddress</a> (const <a class="el" href="classPString.html">PString</a> &amp;fromAddress)</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#a9">SetToAddress</a> (const <a class="el" href="classPString.html">PString</a> &amp;toAddress)</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#a10">SetCC</a> (const <a class="el" href="classPString.html">PString</a> &amp;ccAddress)</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#a11">SetBCC</a> (const <a class="el" href="classPString.html">PString</a> &amp;bccAddress)</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#a12">SetSubject</a> (const <a class="el" href="classPString.html">PString</a> &amp;subject)</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#a13">SetContentType</a> (const <a class="el" href="classPString.html">PString</a> &amp;contentType)</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#a14">SetContentAttachment</a> (const <a class="el" href="classPFilePath.html">PFilePath</a> &amp;filename)</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#a15">SetTransferEncoding</a> (const <a class="el" href="classPString.html">PString</a> &amp;encoding, BOOL autoTranslate=TRUE)</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#a16">SetHeaderField</a> (const <a class="el" href="classPString.html">PString</a> &amp;name, const <a class="el" href="classPString.html">PString</a> &amp;value)</td></tr><tr><td nowrap align=right valign=top>BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#a17">SendWithSMTP</a> (const <a class="el" href="classPString.html">PString</a> &amp;hostname)</td></tr><tr><td nowrap align=right valign=top>BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#a18">SendWithSMTP</a> (<a class="el" href="classPSMTPClient.html">PSMTPClient</a> *smtp)</td></tr><tr><td colspan=2><br><h2>Static Public Attributes</h2></td></tr><tr><td nowrap align=right valign=top>const char&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#p0">MimeVersionTag</a> []</td></tr><tr><td nowrap align=right valign=top>const char&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#p1">FromTag</a> []</td></tr><tr><td nowrap align=right valign=top>const char&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#p2">ToTag</a> []</td></tr><tr><td nowrap align=right valign=top>const char&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#p3">CCTag</a> []</td></tr><tr><td nowrap align=right valign=top>const char&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#p4">BCCTag</a> []</td></tr><tr><td nowrap align=right valign=top>const char&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#p5">SubjectTag</a> []</td></tr><tr><td nowrap align=right valign=top>const char&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#p6">DateTag</a> []</td></tr><tr><td nowrap align=right valign=top>const char&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#p7">ReturnPathTag</a> []</td></tr><tr><td nowrap align=right valign=top>const char&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#p8">ReceivedTag</a> []</td></tr><tr><td nowrap align=right valign=top>const char&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#p9">MessageIDTag</a> []</td></tr><tr><td nowrap align=right valign=top>const char&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#p10">MailerTag</a> []</td></tr><tr><td nowrap align=right valign=top>const char&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#p11">ContentTypeTag</a> []</td></tr><tr><td nowrap align=right valign=top>const char&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#p12">ContentDispositionTag</a> []</td></tr><tr><td nowrap align=right valign=top>const char&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#p13">ContentTransferEncodingTag</a> []</td></tr><tr><td colspan=2><br><h2>Protected Methods</h2></td></tr><tr><td nowrap align=right valign=top>BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#b0">OnOpen</a> ()</td></tr><tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr><tr><td nowrap align=right valign=top>BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#n0">writeHeaders</a></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classPMIMEInfo.html">PMIMEInfo</a>&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#n1">headers</a></td></tr><tr><td nowrap align=right valign=top>BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#n2">writePartHeaders</a></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classPMIMEInfo.html">PMIMEInfo</a>&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#n3">partHeaders</a></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classPStringList.html">PStringList</a>&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#n4">boundaries</a></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classPBase64.html">PBase64</a> *&nbsp;</td><td valign=bottom><a class="el" href="classPRFC822Channel.html#n5">base64</a></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>A channel for sending/receiving RFC822 compliant mail messages. This encpsulates all that is required to send an RFC822 compliant message via another channel. It automatically adds/strips header information from the stream so the <a class="el" href="classPIndirectChannel.html#z157_3">Read()</a> and <a class="el" href="classPRFC822Channel.html#a3">Write()</a> functions only deal with the message body. For example to send a message using the SMTP classes: <pre><code>      <a class="el" href="classPSMTPClient.html">PSMTPClient</a> mail("mailserver");      if (mail.IsOpen()) {        PRFC822Channel message;        message.SetFromAddress("<a href="mailto:Me@here.com.au">Me@here.com.au</a>");        message.SetToAddress("<a href="mailto:Fred@somwhere.com">Fred@somwhere.com</a>");        if (message.Open(mail)) {          if (mail.BeginMessage("<a href="mailto:Me@here.com.au">Me@here.com.au</a>", "<a href="mailto:Fred@somwhere.com">Fred@somwhere.com</a>")) {            if (!message.Write(myMessageBody))              PError &lt;&lt; "Mail write failed." &lt;&lt; endl;            if (!message.EndMessage())              PError &lt;&lt; "Mail send failed." &lt;&lt; endl;          }        }      }      else         PError &lt;&lt; "Mail conection failed." &lt;&lt; endl;      </pre></code> <p><hr><h2>Member Enumeration Documentation</h2><a name="s2" doxytag="PRFC822Channel::Direction"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> enum PRFC822Channel::Direction      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p><dl compact><dt><b>Enumeration values: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em><a name="s2s0" doxytag="Sending"></a><em>Sending</em></em>&nbsp;</td><td></td></tr><tr><td valign=top><em><a name="s2s1" doxytag="Receiving"></a><em>Receiving</em></em>&nbsp;</td><td></td></tr></table></dl>    </td>  </tr></table><hr><h2>Constructor &amp; Destructor Documentation</h2><a name="a0" doxytag="PRFC822Channel::PRFC822Channel"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> PRFC822Channel::PRFC822Channel </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="classPRFC822Channel.html#s2">Direction</a>&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>direction</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Construct a RFC822 aware channel. <dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>direction</em>&nbsp;</td><td>Indicates are sending or receiving a message </td></tr></table></dl>    </td>  </tr></table><a name="a1" doxytag="PRFC822Channel::~PRFC822Channel"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> PRFC822Channel::~PRFC822Channel </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Close the channel before destruction.     </td>  </tr></table><hr><h2>Member Function Documentation</h2><a name="a2" doxytag="PRFC822Channel::Close"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> BOOL PRFC822Channel::Close </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Close the channel. This assures that all mime fields etc are closed off before closing the underliying channel. <p>Reimplemented from <a class="el" href="classPIndirectChannel.html#z157_1">PIndirectChannel</a>.    </td>  </tr></table><a name="a6" doxytag="PRFC822Channel::MultipartMessage"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> BOOL PRFC822Channel::MultipartMessage </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const <a class="el" href="classPString.html">PString</a> &amp;&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>boundary</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Enter multipart MIME message mode. This indicates that the message, or individual part within a message as MIME is nestable, is a multipart message. In this form the user supplies a boundary indicator string which must then be used in all subsequent <a class="el" href="classPRFC822Channel.html#a7">NextPart()</a> calls.<p>Note this must be called before any writes are done to the message or part.     </td>  </tr></table><a name="a5" doxytag="PRFC822Channel::MultipartMessage"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> <a class="el" href="classPString.html">PString</a> PRFC822Channel::MultipartMessage </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Enter multipart MIME message mode. This indicates that the message, or individual part within a message as MIME is nestable, is a multipart message. This form returns the boundary indicator string generated internally which must then be used in all subsequent <a class="el" href="classPRFC822Channel.html#a7">NextPart()</a> calls.<p>Note this must be called before any writes are done to the message or part.     </td>  </tr></table><a name="a4" doxytag="PRFC822Channel::NewMessage"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> void PRFC822Channel::NewMessage </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="classPRFC822Channel.html#s2">Direction</a>&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>direction</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Begin a new message. This may be used if the object is to encode 2 or more messages sequentially. It resets the internal state of the object. <dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>direction</em>&nbsp;</td><td>Indicates are sending or receiving a message </td></tr></table></dl>    </td>  </tr></table><a name="a7" doxytag="PRFC822Channel::NextPart"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> void PRFC822Channel::NextPart </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const <a class="el" href="classPString.html">PString</a> &amp;&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>boundary</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Indicate that a new multipart message part is to begin. This will close off the previous part, and any nested multipart messages contained therein, and allow a new part to begin.<p>The user may adjust the parts content type and other header fields after this call and before the first write of the parts body. The default Content-Type is "text/plain".<p>Note that all header fields are cleared from the previous part.     </td>  </tr></table><a name="b0" doxytag="PRFC822Channel::OnOpen"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> BOOL PRFC822Channel::OnOpen </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [protected, virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>This callback is executed when the <a class="el" href="classPIndirectChannel.html#z159_0">Open()</a> function is called with open channels. It may be used by descendent channels to do any handshaking required by the protocol that channel embodies.<p>The default behaviour is to simply return TRUE.<p><dl compact><dt><b>Returns: </b></dt><dd> Returns TRUE if the protocol handshaking is successful. </dl><p>Reimplemented from <a class="el" href="classPIndirectChannel.html#b0">PIndirectChannel</a>.    </td>  </tr></table><a name="a18" doxytag="PRFC822Channel::SendWithSMTP"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> BOOL PRFC822Channel::SendWithSMTP </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="classPSMTPClient.html">PSMTPClient</a> *&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>smtp</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Send this message using an SMTP socket. This assumes <a class="el" href="classPSMTPClient.html">PSMTPClient</a> is open the sends the message to the remote SMTP server.     </td>  </tr></table><a name="a17" doxytag="PRFC822Channel::SendWithSMTP"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> BOOL PRFC822Channel::SendWithSMTP </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const <a class="el" href="classPString.html">PString</a> &amp;&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>hostname</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -