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

📄 csimplesmtpclient.html

📁 email收发软件例子源代码
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<html><head><title>CSimpleSMTPClient Documentation</title></head>
<body><h1>
<a name="topofdoc"><img src="logo.gif">CSimpleSMTPClient</a></h1>
<dl>
<dd>
    Simple API for sending Internet Emails (via SMTP).

</dl>
<hr><p></p>
<p><strong>[ 
<a href="SimpleEmailClient.html">SimpleEmailClient</a> | 
<a href="SimpleSMTPClient.h">Source</a> | 
<a href="/keyweb.html">Keywords</a> | 
<a href="#aag">Summary</a> | <a href="#parents">Ancestors</a> | <a href="#flat">All Members</a> | <a href="#children">Descendants</a>  ]</strong><p>
<h2><a name="quickind">Quick Index</a></h2>
<dl>
<dd><a href="#DESCRIPTION">DESCRIPTION</a>
<dd><a href="#USAGE">USAGE</a>
<dd><a href="#EXAMPLE">EXAMPLE</a>
<dd><a href="#ADMINISTRATIVE">ADMINISTRATIVE</a>
<dd><a href="#SEE_ALSO">SEE ALSO</a>
</dl>
<a name="aag"><hr><p></p></a><h2>Class Summary</h2>
class CSimpleSMTPClient<br>
<br>
 {
<br>
<br><i><b>public</b></i>:
<dl>
<dd><a href="CSimpleSMTPClient.html#CSimpleSMTPClient(LPCTSTR_lpszSMTPServerNames,_UINT_uPortNumber_,_UINT_uTimeOut_)$"><font color=green>CSimpleSMTPClient</font></a>(LPCTSTR lpszSMTPServerNames, UINT uPortNumber , UINT uTimeOut );
<dd>~<i><a href="CSimpleSMTPClient.html#~CSimpleSMTPClient()$"><font color=green>CSimpleSMTPClient</font></a></i>();
<dd>HRESULT <a href="CSimpleSMTPClient.html#HRESULT_SendEmail(LPCTSTR_lpszFrom,_LPCTSTR_lpszTo,_LPCTSTR_lpszSubject,_LPCTSTR_lpszBody)$"><font color=green>SendEmail</font></a>(LPCTSTR lpszFrom, LPCTSTR lpszTo, LPCTSTR lpszSubject, LPCTSTR lpszBody);
<dd>CString <a href="CSimpleSMTPClient.html#CString_GetLastErrorMessage(void)$"><font color=green>GetLastErrorMessage</font></a>(void);
</dl>
<i><b>protected</b></i>:
<dl>
<dd>BOOL <a href="CSimpleSMTPClient.html#BOOL_BuildListFromString(LPCTSTR_lpszStringWithSeparators,_CStringList_&amp$oList)$"><font color=green>BuildListFromString</font></a>(LPCTSTR lpszStringWithSeparators, CStringList &amp;oList);
<dd>CString <a href="CSimpleSMTPClient.html#CString_BuildStringFromList(CStringList_&amp$oList,_LPCTSTR_lpszSeparator)$"><font color=green>BuildStringFromList</font></a>(CStringList &amp;oList, LPCTSTR lpszSeparator);
<dd>CString <a href="CSimpleSMTPClient.html#CString_BuildRFC822Address(LPCTSTR_lpszAddress)$"><font color=green>BuildRFC822Address</font></a>(LPCTSTR lpszAddress);
<dd>CString <a href="CSimpleSMTPClient.html#CString_ExtractSMTPAddress(LPCTSTR_lpszAddress)$"><font color=green>ExtractSMTPAddress</font></a>(LPCTSTR lpszAddress);
<dd>BOOL <a href="CSimpleSMTPClient.html#BOOL_GetHostName(CString_&amp$szFullyQualifiedHostName)$"><font color=green>GetHostName</font></a>(CString &amp;szFullyQualifiedHostName);
<dd>HRESULT <a href="CSimpleSMTPClient.html#HRESULT_SendEmailToServer(LPCTSTR_lpszServerName,_LPCTSTR_lpszFrom,_LPCTSTR_lpszTo,_LPCTSTR_lpszSubject,_LPCTSTR_lpszBody)$"><font color=green>SendEmailToServer</font></a>(LPCTSTR lpszServerName, LPCTSTR lpszFrom, LPCTSTR lpszTo, LPCTSTR lpszSubject, LPCTSTR lpszBody);
</dl>
}; // CSimpleSMTPClient <p>
<p>Back to the <a href="#topofdoc">top</a> of  <i>CSimpleSMTPClient</i><p>
<a name="DESCRIPTION"><hr><p></p></a><h3>DESCRIPTION</h3>
<p>
    This class provides a simple API to send Internet Emails via the
    Simple Mail Transfer Protocol (SMTP).
<p>
    This class succeeded in sending email messages to the following SMTP servers:
    <UL>
        <LI>Lotus SMTP MTA Service
        <LI>ESMTP Sendmail 8.8.8
        <LI>ESMTP Sendmail 8.9.3
        <LI>ESMTP Postfix
    </UL>
<p>
<p>Back to the <a href="#topofdoc">top</a> of  <i>CSimpleSMTPClient</i><p>
<a name="USAGE"><hr><p></p></a><h3>USAGE</h3>
<p>
    To use this class:
    <UL>
        <LI>Create an instance of the class, passing the SMTP Server Name (or address)
        <LI>Call method <a href="#HRESULT_SendEmail(LPCTSTR_lpszFrom,_LPCTSTR_lpszTo,_LPCTSTR_lpszSubject,_LPCTSTR_lpszBody)$">SendEmail</a>()
    </UL>
<p>
<p>Back to the <a href="#topofdoc">top</a> of  <i>CSimpleSMTPClient</i><p>
<a name="EXAMPLE"><hr><p></p></a><h3>EXAMPLE</h3>
<p>
<PRE>
    // Create instance
    CSimpleSMTPClient oSMTPClient("smtp.mydomain.com");
<p>
    HRESULT hResult = oSMTPClient.<a href="#HRESULT_SendEmail(LPCTSTR_lpszFrom,_LPCTSTR_lpszTo,_LPCTSTR_lpszSubject,_LPCTSTR_lpszBody)$">SendEmail</a>("me@mydomain.com",
                                            "you@yourdomain.com",
                                            "This is my subject...",
                                            "This is the body text...");
    if (FAILED(hResult)) {
<p>
        // Log error
<p>
        [...]
<p>
    } else {
<p>
        // Email sent successfully
<p>
        [...]
<p>
    }
</PRE>
<p>
<p>Back to the <a href="#topofdoc">top</a> of  <i>CSimpleSMTPClient</i><p>
<a name="ADMINISTRATIVE"><hr><p></p></a><h3>ADMINISTRATIVE</h3>
<p>
  Author     Emmanuel KARTMANN
<p>
  Date       Tuesday 11/17/98
<p>
<p>Back to the <a href="#topofdoc">top</a> of  <i>CSimpleSMTPClient</i><p>
<a name="SEE_ALSO"><hr><p></p></a><h3>SEE ALSO</h3>
<p>
    <a href="CSimpleSocket.html">CSimpleSocket</a> CSocket <A HREF="http://www.ietf.org/rfc/rfc0822.txt">RFC822</A>
    <A HREF="http://www.ietf.org/rfc/rfc0821.txt">RFC821</A>
<p>
<p>Back to the <a href="#topofdoc">top</a> of  <i>CSimpleSMTPClient</i><p>
<a name="CSimpleSMTPClient(LPCTSTR_lpszSMTPServerNames,_UINT_uPortNumber_,_UINT_uTimeOut_)$"><hr><p></p><h3>CSimpleSMTPClient(LPCTSTR lpszSMTPServerNames, UINT uPortNumber , UINT uTimeOut );</h3></a>
<p>
   <U>Purpose:</U> create an instance of the class
<p>
   <U>Parameters:</U> 
<p>
<dl><dl>
<dt><i>in</i><strong> lpszSMTPServerNames</strong>
<dd>                  List of IP name or IP address of the SMTP Servers
                  (string with names separated by commas).
<dt><i>in</i><strong> uPortNumber</strong>
<dd>                  SMTP port number (defaults to 25)
<dt><i>in</i><strong> uTimeOut</strong>
<dd>                  timeout (in milliseconds) for connection/send/receive
                  (defaults to 30 seconds)
<p>
</dl></dl>
   <U>Return value :</U> none (C++ constructor)
<p>
   <U>Description  :</U> 
<p>
<p><pre>
    <a href="#CSimpleSMTPClient(LPCTSTR_lpszSMTPServerNames,_UINT_uPortNumber_,_UINT_uTimeOut_)$">CSimpleSMTPClient</a>(LPCTSTR lpszSMTPServerNames, UINT uPortNumber = 25, UINT uTimeOut = 30000);
</pre>
<br><p>Back to the <a href="#topofdoc">top</a> of  <i> CSimpleSMTPClient </i> <p>
<a name="~CSimpleSMTPClient()$"><hr><p></p><h3>~CSimpleSMTPClient();</h3></a>
<p>
   <U>Purpose:</U> delete an instance of the class
<p>
   <U>Parameters:</U> none (C++ destructor)
<p>
   <U>Return value :</U> none (C++ destructor)
<p>
   <U>Description  :</U> 
<p>
<p><pre>
    virtual ~CSimpleSMTPClient();
</pre>
<br><p>Back to the <a href="#topofdoc">top</a> of  <i> CSimpleSMTPClient </i> <p>
<a name="HRESULT_SendEmail(LPCTSTR_lpszFrom,_LPCTSTR_lpszTo,_LPCTSTR_lpszSubject,_LPCTSTR_lpszBody)$"><hr><p></p><h3>HRESULT SendEmail(LPCTSTR lpszFrom, LPCTSTR lpszTo, LPCTSTR lpszSubject, LPCTSTR lpszBody);</h3></a>
<p>
   <U>Purpose:</U> send an email message (via SMTP)
<p>
   <U>Parameters:</U> 
<p>
<dl><dl>
<dt><i>in</i><strong> lpszFrom</strong>
<dd>                  message originator (one RFC822 address). You can use
                  full addresses (e.g. "Emmanuel KARTMANN <emmanuel@kartmann.com>")
                  or raw addresses (e.g. "emmanuel@kartmann.com").
<dt><i>in</i><strong> lpszTo</strong>
<dd>                  message recipients (list of RFC822 addresses, 
                  separated by commas or semicolons). You can use
                  full addresses (e.g. "Emmanuel KARTMANN <emmanuel@kartmann.com>")
                  or raw addresses (e.g. "emmanuel@kartmann.com").
<dt><i>in</i><strong> lpszSubject</strong>
<dd>                  message subject
<dt><i>in</i><strong> lpszBody</strong>
<dd>                  message body
<p>
</dl></dl>
   <U>Return value :</U> HRESULT = S_OK (0) for success
<p>
   <U>Description  :</U> This function tries to send the email message
                         using all known SMTP servers (see constructor).
                         It calls function <a href="#HRESULT_SendEmailToServer(LPCTSTR_lpszServerName,_LPCTSTR_lpszFrom,_LPCTSTR_lpszTo,_LPCTSTR_lpszSubject,_LPCTSTR_lpszBody)$">SendEmailToServer</a>() until
                         one server accepts to deliver the email message.
<p>
<p><pre>
    HRESULT <a href="#HRESULT_SendEmail(LPCTSTR_lpszFrom,_LPCTSTR_lpszTo,_LPCTSTR_lpszSubject,_LPCTSTR_lpszBody)$">SendEmail</a>(LPCTSTR lpszFrom, LPCTSTR lpszTo, LPCTSTR lpszSubject, LPCTSTR lpszBody);
</pre>
<br><p>Back to the <a href="#topofdoc">top</a> of  <i> CSimpleSMTPClient </i> <p>
<a name="CString_GetLastErrorMessage(void)$"><hr><p></p><h3>CString GetLastErrorMessage(void);</h3></a>
<p>
   <U>Purpose:</U> returns the last error message
<p>
   <U>Parameters:</U> none

⌨️ 快捷键说明

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