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

📄 pop3.htm

📁 一个支持POP3(Post Office Protocol Version 3)的MFC类
💻 HTM
📖 第 1 页 / 共 2 页
字号:
<p><a name="GetMessageID"></a><big><strong><font face="Arial">CPop3Connection::GetMessageID</font></strong></big></p>

<p><font face="Arial"><strong>BOOL CPop3Connection::GetMessageID(int </strong><em>nMsg</em><strong>,
CString&amp; </strong><em>sID</em><strong>);</strong></font></p>

<p class="rl"><strong><font face="Arial">Return Value</font></strong></p>

<p class="t"><font face="Arial">If the function succeeds, the return value is TRUE. If the
function fails, the return value is FALSE. To get extended error information, call
::GetLastError.</font></p>

<p><font face="Arial"><strong>Parameters</strong></font></p>

<p><font face="Arial"><em>nMsg</em> The message number of the message to retrieve the ID
of.</font></p>

<p><font face="Arial"><em>sID</em> Upon a successful return this will contain the ID of
the specified message as a string.</font></p>

<p><font face="Arial"><strong>Remarks</strong></font></p>

<p><font face="Arial">Retrieves the ID of a specified message. Internally this will issue
the &quot;UIDL&quot; command if required. As &quot;UIDL&quot; is an optional POP3 command,
your client app should handle the return value if it is to correctly work on all POP3
servers.</font></p>

<p><strong><font face="Arial">See Also </font></strong></p>

<p><a href="#UIDL"><font face="Arial">CPop3Connection::UIDL</font></a></p>

<p>&nbsp;</p>

<p><a name="Retrieve"></a><big><strong><font face="Arial">CPop3Connection::Retrieve</font></strong></big></p>

<p><font face="Arial"><strong>BOOL CPop3Connection::Retrieve(int </strong><em>nMsg</em><strong>,
CPop3Message&amp; </strong><em>message</em><strong>);</strong></font></p>

<p class="rl"><strong><font face="Arial">Return Value</font></strong></p>

<p class="t"><font face="Arial">If the function succeeds, the return value is TRUE. If the
function fails, the return value is FALSE. To get extended error information, call
::GetLastError.</font></p>

<p><font face="Arial"><strong>Parameters</strong></font></p>

<p><font face="Arial"><em>nMsg</em> The message number of the message to retrieve the size
of.</font></p>

<p><font face="Arial"><em>message</em> Upon a successful return this will contain the POP3
messages.</font></p>

<p><font face="Arial"><strong>Remarks</strong></font></p>

<p><font face="Arial">Retrieves the specified message by issuing the &quot;RETR&quot;
command.</font></p>

<p><strong><font face="Arial">See Also </font></strong></p>

<p><a href="#GetMessageSize"><font face="Arial">CPop3Connection::GetMessageSize</font></a></p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p><a name="GetMessageHeader"></a><big><strong><font face="Arial">CPop3Connection::GetMessageHeader</font></strong></big></p>

<p><font face="Arial"><strong>BOOL CPop3Connection::GetMessageHeader(int </strong><em>nMsg</em><strong>,
CPop3Message&amp; </strong><em>message</em><strong>);</strong></font></p>

<p class="rl"><strong><font face="Arial">Return Value</font></strong></p>

<p class="t"><font face="Arial">If the function succeeds, the return value is TRUE. If the
function fails, the return value is FALSE. To get extended error information, call
::GetLastError.</font></p>

<p><font face="Arial"><strong>Parameters</strong></font></p>

<p><font face="Arial"><em>nMsg</em> The message number of the message to retrieve the
header of.</font></p>

<p><font face="Arial"><em>sID</em> Upon a successful return this will contain the POP3
messages.</font></p>

<p><font face="Arial"><strong>Remarks</strong></font></p>

<p><font face="Arial">Retrieves the header of a specified message. Internally this will
issue the &quot;TOP&quot; command if required. As &quot;TOP&quot; is an optional POP3
command, your client app should handle the return value if it is to correctly work on all
POP3 servers.</font></p>

<p><strong><font face="Arial">See Also </font></strong></p>

<p><a href="#GetMessage"><font face="Arial">CPop3Connection::GetMessage</font></a></p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p><a name="Reset"></a><big><strong><font face="Arial">CPop3Connection::Reset</font></strong></big></p>

<p><strong><font face="Arial">BOOL CPop3Connection::Reset();</font></strong></p>

<p class="rl"><strong><font face="Arial">Return Value</font></strong></p>

<p class="t"><font face="Arial">If the function succeeds, the return value is TRUE. If the
function fails, the return value is FALSE. To get extended error information, call
::GetLastError.</font></p>

<p><font face="Arial"><strong>Parameters</strong></font></p>

<p><font face="Arial">None.</font></p>

<p><font face="Arial"><strong>Remarks</strong></font></p>

<p><font face="Arial">Resets all messages which were previously marked as deleted. i.e. it
undoes the work of all the DELE commands in this session. For further information about
how messages are deleted in POP3, please refer to the RFC.</font></p>

<p><strong><font face="Arial">See Also </font></strong></p>

<p><a href="#Delete"><font face="Arial">CPop3Connection::Delete</font></a></p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p><a name="UIDL"></a><big><strong><font face="Arial">CPop3Connection::UIDL</font></strong></big></p>

<p><strong><font face="Arial">BOOL CPop3Connection::UIDL();</font></strong></p>

<p class="rl"><strong><font face="Arial">Return Value</font></strong></p>

<p class="t"><font face="Arial">If the function succeeds, the return value is TRUE. If the
function fails, the return value is FALSE. To get extended error information, call
::GetLastError.</font></p>

<p><font face="Arial"><strong>Parameters</strong></font></p>

<p><font face="Arial">None.</font></p>

<p><font face="Arial"><strong>Remarks</strong></font></p>

<p><font face="Arial">Sends the &quot;UIDL&quot; command which retrieves the ID for a
specified message. As &quot;UIDL&quot; is an optional POP3 command, your client app should
handle the return value if it is to correctly work on all POP3 servers.</font></p>

<p><strong><font face="Arial">See Also </font></strong></p>

<p><a href="#GetMessageID"><font face="Arial">CPop3Connection::GetMessageID</font></a></p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p><a name="Noop"></a><big><strong><font face="Arial">CPop3Connection::Noop</font></strong></big></p>

<p><strong><font face="Arial">BOOL CPop3Connection::Noop();</font></strong></p>

<p class="rl"><strong><font face="Arial">Return Value</font></strong></p>

<p class="t"><font face="Arial">If the function succeeds, the return value is TRUE. If the
function fails, the return value is FALSE. To get extended error information, call
::GetLastError.</font></p>

<p><font face="Arial"><strong>Parameters</strong></font></p>

<p><font face="Arial">None.</font></p>

<p><font face="Arial"><strong>Remarks</strong></font></p>

<p><font face="Arial">Issues a &quot;NOOP&quot; command to the server.</font></p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p><a name="GetLastCommandResponse"></a><big><strong><font face="Arial">CPop3Connection::GetLastCommandResponse</font></strong></big></p>

<p><strong><font face="Arial">CString CPop3Connection::GetLastCommandResponse() const;</font></strong></p>

<p class="rl"><strong><font face="Arial">Return Value</font></strong></p>

<p class="t"><font face="Arial">The last command response from the server as a CString.</font></p>

<p><font face="Arial"><strong>Parameters</strong></font></p>

<p><font face="Arial">None.</font></p>

<p><font face="Arial"><strong>Remarks</strong></font></p>

<p><font face="Arial">The CPop3Connection class can return additional text information
along with most errors. This extended error information can be retrieved by using the
GetLastCommandResponse function after an unsuccessful function call. An example of this is
if the Connect function failed because of a validation problem, GetLastCommandResponse
could return something like &quot;-ERR Access is denied&quot;. GetLastCommandResponse can
be called multiple times until another CPop3Connection function is called which sends a
POP3 command. </font></p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p><a name="GetTimeout"></a><big><strong><font face="Arial">CPop3Connection::GetTimeout</font></strong></big></p>

<p><strong><font face="Arial">DWORD CPop3Connection::GetTimeout() const;</font></strong></p>

<p class="rl"><strong><font face="Arial">Return Value</font></strong></p>

<p class="t"><font face="Arial">The timeout in milliseconds which the code will wait for
responses from the POP3 server.</font></p>

<p><font face="Arial"><strong>Parameters</strong></font></p>

<p><font face="Arial">None.</font></p>

<p><font face="Arial"><strong>Remarks</strong></font></p>

<p><font face="Arial">Since CPop3Connection provides a synchronous API, a timeout
mechanism is provided. By default the value is 2 seconds in release mode and 20 seconds in
debug mode. The value is larger in debug mode so that the code does not time out when you
are debugging it.</font></p>

<p><strong><font face="Arial">See Also </font></strong></p>

<p><a href="#SetTimeout"><font face="Arial">CPop3Connection::SetTimeout</font></a></p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p><a name="SetTimeout"></a><big><strong><font face="Arial">CPop3Message::SetTimeout</font></strong></big></p>

<p><font face="Arial"><strong>void CPop3Connection::SetTimeout(DWORD </strong><em>dwTimeout</em><strong>)
const;</strong></font></p>

<p class="rl"><strong><font face="Arial">Return Value</font></strong></p>

<p class="t"><font face="Arial">None.</font></p>

<p><font face="Arial"><strong>Parameters</strong></font></p>

<p><font face="Arial"><em>dwTimeout</em> The new timeout value in milliseconds.</font></p>

<p><font face="Arial"><strong>Remarks</strong></font></p>

<p><font face="Arial">Sets the timeout to use for connections to the POP3 server.</font></p>

<p><strong><font face="Arial">See Also </font></strong></p>

<p><a href="#GetTimeout"><font face="Arial">CPop3Connection::GetTimeout</font></a></p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p><a name="GetMessageText" href="#GetMessageText"></a><big><strong><font face="Arial">CPop3Message::GetMessageText</font></strong></big></p>

<p><strong><font face="Arial">const char* CPop3Connection::GetMessageText() const;</font></strong></p>

<p class="rl"><strong><font face="Arial">Return Value</font></strong></p>

<p class="t"><font face="Arial">A character pointer to the actual message text this class
instance represents.</font></p>

<p><font face="Arial"><strong>Parameters</strong></font></p>

<p><font face="Arial">None.</font></p>

<p><font face="Arial"><strong>Remarks</strong></font></p>

<p><font face="Arial">Upon a successful call to CPop3Connection::Retrieve, the message
class will contain a message. This function allows the text to of the message to be
accessed. In the future the CPop3Message will be expanded to include a more complete set
of functions.</font></p>

<p><strong><font face="Arial">See Also </font></strong></p>

<p><a href="#Retrieve"><font face="Arial">CPop3Connection::Retrieve</font></a></p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p><font face="Arial"><big><a name="Enhancements"></a></big><font color="#000000" size="4"><strong>PLANNED
ENHANCEMENTS</strong></font> </font>

<ul>
  <li><font face="Arial">Implement support for the final 2 POP3 commands which CPop3Connection
    does not support, namely APOP and TOP.</font></li>
  <li><font face="Arial">Package the code up into an OCX, COM Interface or DLL to allow non
    MFC apps to use the code.</font></li>
  <li><font face="Arial">Include MFC diagnostic functions.</font></li>
  <li><font face="Arial">Provide a better sample app. At the moment, it's very much a test
    program which tests all of the functions.</font></li>
  <li><font face="Arial" color="#000000" size="3">If you have any other suggested
    improvements, please let me know so that I can incorporate them into the next release.</font></li>
</ul>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p><font face="Arial"><a name="Contact"></a><font color="#000000" size="4"><strong>CONTACTING
THE AUTHOR</strong></font></font></p>

<p><font face="Arial" color="#000000" size="3">PJ Naughter<br>
Email: <a href="mailto:pjn@indigo..ie">pjn@indigo.ie</a><br>
Web: <a href="http://indigo.ie/~pjn">http://indigo.ie/~pjn</a><br>
4th January 1999</font></p>
</body>
</html>

⌨️ 快捷键说明

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