File: Poco.Net.SMTPClientSession.html

package info (click to toggle)
poco-doc 1.3.6-1
  • links: PTS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, squeeze, stretch, wheezy
  • size: 10,076 kB
  • ctags: 9,611
  • sloc: makefile: 31
file content (204 lines) | stat: -rw-r--r-- 14,865 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<!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>
<title>Class Poco::Net::SMTPClientSession</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="author" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="publisher" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="copyright" content="Copyright (c) 2009, Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="language" content="en"/>
<meta name="date" content="2009-11-24"/>
<meta name="generator" content="PocoDoc"/>
<link rel="stylesheet" href="css/styles.css" type="text/css"/>
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0">
<div class="header">
<h1 class="namespace"><a href="Poco.Net.html" class="namespace">Poco::Net</a></h1>
<h1 class="symbol">class SMTPClientSession</h1>
</div>
<div class="body">
<p>
<b>Library:</b> Net<br />
<b>Package:</b> Mail<br />
<b>Header:</b> Poco/Net/SMTPClientSession.h</p>
<h2>Description</h2>
<div class="description">
<p>This class implements an Simple Mail Transfer Procotol (SMTP, <a href="http://www.ietf.org/rfc/rfc2821.txt" target="_blank">RFC 2821</a>) client for sending e-mail messages. </p>
</div>
<h2>Member Summary</h2>
<p><b>Member Functions: </b><a href="Poco.Net.SMTPClientSession.html#14898" title="Poco::Net::SMTPClientSession::close()">close</a>, <a href="Poco.Net.SMTPClientSession.html#14889" title="Poco::Net::SMTPClientSession::getTimeout()">getTimeout</a>, <a href="Poco.Net.SMTPClientSession.html#14921" title="Poco::Net::SMTPClientSession::isPermanentNegative()">isPermanentNegative</a>, <a href="Poco.Net.SMTPClientSession.html#14915" title="Poco::Net::SMTPClientSession::isPositiveCompletion()">isPositiveCompletion</a>, <a href="Poco.Net.SMTPClientSession.html#14917" title="Poco::Net::SMTPClientSession::isPositiveIntermediate()">isPositiveIntermediate</a>, <a href="Poco.Net.SMTPClientSession.html#14919" title="Poco::Net::SMTPClientSession::isTransientNegative()">isTransientNegative</a>, <a href="Poco.Net.SMTPClientSession.html#14890" title="Poco::Net::SMTPClientSession::login()">login</a>, <a href="Poco.Net.SMTPClientSession.html#14926" title="Poco::Net::SMTPClientSession::loginUsingCRAM_MD5()">loginUsingCRAM_MD5</a>, <a href="Poco.Net.SMTPClientSession.html#14929" title="Poco::Net::SMTPClientSession::loginUsingLogin()">loginUsingLogin</a>, <a href="Poco.Net.SMTPClientSession.html#14932" title="Poco::Net::SMTPClientSession::loginUsingPlain()">loginUsingPlain</a>, <a href="Poco.Net.SMTPClientSession.html#14897" title="Poco::Net::SMTPClientSession::open()">open</a>, <a href="Poco.Net.SMTPClientSession.html#14901" title="Poco::Net::SMTPClientSession::sendCommand()">sendCommand</a>, <a href="Poco.Net.SMTPClientSession.html#14899" title="Poco::Net::SMTPClientSession::sendMessage()">sendMessage</a>, <a href="Poco.Net.SMTPClientSession.html#14887" title="Poco::Net::SMTPClientSession::setTimeout()">setTimeout</a></p>
<h2>Enumerations</h2>
<h3><i>Anonymous</i></h3>
<div class="description">
<p></p>
</div>
<p class="decl"><a name="14876">SMTP_PORT</a> = 25</p>
<div class="description">
<p></p>
</div>
<h3><i>Anonymous</i> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<div class="description">
<p></p>
</div>
<p class="decl"><a name="14914">DEFAULT_TIMEOUT</a> = 30000000</p>
<div class="description">
<p></p>
</div>
<h3><a name="14877">LoginMethod</a></h3>
<div class="description">
<p></p>
</div>
<p class="decl"><a name="14878">AUTH_NONE</a></p>
<div class="description">
<p></p>
</div>
<p class="decl"><a name="14879">AUTH_CRAM_MD5</a></p>
<div class="description">
<p></p>
</div>
<p class="decl"><a name="14880">AUTH_LOGIN</a></p>
<div class="description">
<p></p>
</div>
<h3><a name="14908">StatusClass</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<div class="description">
<p></p>
</div>
<p class="decl"><a name="14909">SMTP_POSITIVE_COMPLETION</a> = 2</p>
<div class="description">
<p></p>
</div>
<p class="decl"><a name="14910">SMTP_POSITIVE_INTERMEDIATE</a> = 3</p>
<div class="description">
<p></p>
</div>
<p class="decl"><a name="14911">SMTP_TRANSIENT_NEGATIVE</a> = 4</p>
<div class="description">
<p></p>
</div>
<p class="decl"><a name="14912">SMTP_PERMANENT_NEGATIVE</a> = 5</p>
<div class="description">
<p></p>
</div>
<h2>Constructors</h2>
<h3><a name="14881">SMTPClientSession</a></h3>
<p class="decl">explicit <a href="Poco.Net.SMTPClientSession.html" title="class Poco::Net::SMTPClientSession">SMTPClientSession</a>(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.Net.StreamSocket.html" title="class Poco::Net::StreamSocket">StreamSocket</a> &amp; socket<br />);</p>
<div class="description">
<p>Creates the <a href="Poco.Net.SMTPClientSession.html" title="class Poco::Net::SMTPClientSession">SMTPClientSession</a> using the given socket, which must be connected to a SMTP server. </p>
</div>
<h3><a name="14883">SMTPClientSession</a></h3>
<p class="decl"><a href="Poco.Net.SMTPClientSession.html" title="class Poco::Net::SMTPClientSession">SMTPClientSession</a>(<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; host,<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.html#11352" title="Poco::UInt16">Poco::UInt16</a> port = SMTP_PORT<br />);</p>
<div class="description">
<p>Creates the <a href="Poco.Net.SMTPClientSession.html" title="class Poco::Net::SMTPClientSession">SMTPClientSession</a> using a socket connected to the given host and port. </p>
</div>
<h2>Destructor</h2>
<h3><a name="14886">~SMTPClientSession</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual ~<a href="Poco.Net.SMTPClientSession.html" title="class Poco::Net::SMTPClientSession">SMTPClientSession</a>();</p>
<div class="description">
<p>Destroys the <a href="Poco.Net.SMTPClientSession.html" title="class Poco::Net::SMTPClientSession">SMTPClientSession</a>. </p>
</div>
<h2>Member Functions</h2>
<h3><a name="14898">close</a></h3>
<p class="decl">void close();</p>
<div class="description">
<p>Sends a QUIT command and closes the connection to the server.	 </p>
<p>Throws a <a href="Poco.Net.SMTPException.html" title="class Poco::Net::SMTPException">SMTPException</a> in case of a SMTP-specific error, or a <a href="Poco.Net.NetException.html" title="class Poco::Net::NetException">NetException</a> in case of a general network communication failure. </p>
</div>
<h3><a name="14889">getTimeout</a></h3>
<p class="decl"><a href="Poco.Timespan.html" title="class Poco::Timespan">Poco::Timespan</a> getTimeout() const;</p>
<div class="description">
<p>Returns the timeout for socket read operations. </p>
</div>
<h3><a name="14890">login</a></h3>
<p class="decl">void login(<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; hostname<br />);</p>
<div class="description">
<p>Greets the SMTP server by sending a EHLO command with the given hostname as argument. </p>
<p>If the server does not understand the EHLO command, a HELO command is sent instead. </p>
<p>Throws a <a href="Poco.Net.SMTPException.html" title="class Poco::Net::SMTPException">SMTPException</a> in case of a SMTP-specific error, or a <a href="Poco.Net.NetException.html" title="class Poco::Net::NetException">NetException</a> in case of a general network communication failure. </p>
</div>
<h3><a name="14892">login</a></h3>
<p class="decl">void login();</p>
<div class="description">
<p>Calls <a href="Poco.Net.SMTPClientSession.html#14890" title="Poco::Net::SMTPClientSession::login()">login</a>(hostname) with the current host name. </p>
</div>
<h3><a name="14893">login</a></h3>
<p class="decl">void login(<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.Net.SMTPClientSession.html#14877" title="enum  Poco::Net::SMTPClientSession::LoginMethod">LoginMethod</a> loginMethod,<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; username,<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; password<br />);</p>
<div class="description">
<p>Logs in to the SMTP server using the given authentication method and the given credentials. </p>
</div>
<h3><a name="14897">open</a></h3>
<p class="decl">void open();</p>
<div class="description">
<p>Reads the initial response from the SMTP server. </p>
<p>Usually called implicitly through <a href="Poco.Net.SMTPClientSession.html#14890" title="Poco::Net::SMTPClientSession::login()">login</a>(), but can also be called explicitly to implement different forms of SMTP authentication. </p>
<p>Does nothing if called more than once. </p>
</div>
<h3><a name="14901">sendCommand</a></h3>
<p class="decl">int sendCommand(<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; command,<br />&nbsp;&nbsp;&nbsp;&nbsp;std::string &amp; response<br />);</p>
<div class="description">
<p>Sends the given command verbatim to the server and waits for a response. </p>
<p>Throws a <a href="Poco.Net.SMTPException.html" title="class Poco::Net::SMTPException">SMTPException</a> in case of a SMTP-specific error, or a <a href="Poco.Net.NetException.html" title="class Poco::Net::NetException">NetException</a> in case of a general network communication failure. </p>
</div>
<h3><a name="14904">sendCommand</a></h3>
<p class="decl">int sendCommand(<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; command,<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; arg,<br />&nbsp;&nbsp;&nbsp;&nbsp;std::string &amp; response<br />);</p>
<div class="description">
<p>Sends the given command verbatim to the server and waits for a response. </p>
<p>Throws a <a href="Poco.Net.SMTPException.html" title="class Poco::Net::SMTPException">SMTPException</a> in case of a SMTP-specific error, or a <a href="Poco.Net.NetException.html" title="class Poco::Net::NetException">NetException</a> in case of a general network communication failure. </p>
</div>
<h3><a name="14899">sendMessage</a></h3>
<p class="decl">void sendMessage(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.Net.MailMessage.html" title="class Poco::Net::MailMessage">MailMessage</a> &amp; message<br />);</p>
<div class="description">
<p>Sends the given mail message by sending a MAIL FROM command, a RCPT TO command for every recipient, and a DATA command with the message headers and content. </p>
<p>Throws a <a href="Poco.Net.SMTPException.html" title="class Poco::Net::SMTPException">SMTPException</a> in case of a SMTP-specific error, or a <a href="Poco.Net.NetException.html" title="class Poco::Net::NetException">NetException</a> in case of a general network communication failure. </p>
</div>
<h3><a name="14887">setTimeout</a></h3>
<p class="decl">void setTimeout(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.Timespan.html" title="class Poco::Timespan">Poco::Timespan</a> &amp; timeout<br />);</p>
<div class="description">
<p>Sets the timeout for socket read operations. </p>
</div>
<h3><a name="14921">isPermanentNegative</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" />  <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" />  <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static bool isPermanentNegative(<br />&nbsp;&nbsp;&nbsp;&nbsp;int status<br />);</p>
<div class="description">
<p></p>
</div>
<h3><a name="14915">isPositiveCompletion</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" />  <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" />  <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static bool isPositiveCompletion(<br />&nbsp;&nbsp;&nbsp;&nbsp;int status<br />);</p>
<div class="description">
<p></p>
</div>
<h3><a name="14917">isPositiveIntermediate</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" />  <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" />  <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static bool isPositiveIntermediate(<br />&nbsp;&nbsp;&nbsp;&nbsp;int status<br />);</p>
<div class="description">
<p></p>
</div>
<h3><a name="14919">isTransientNegative</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" />  <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" />  <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static bool isTransientNegative(<br />&nbsp;&nbsp;&nbsp;&nbsp;int status<br />);</p>
<div class="description">
<p></p>
</div>
<h3><a name="14923">login</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void login(<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; hostname,<br />&nbsp;&nbsp;&nbsp;&nbsp;std::string &amp; response<br />);</p>
<div class="description">
<p></p>
</div>
<h3><a name="14926">loginUsingCRAM_MD5</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void loginUsingCRAM_MD5(<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; username,<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; password<br />);</p>
<div class="description">
<p></p>
</div>
<h3><a name="14929">loginUsingLogin</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void loginUsingLogin(<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; username,<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; password<br />);</p>
<div class="description">
<p></p>
</div>
<h3><a name="14932">loginUsingPlain</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void loginUsingPlain(<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; username,<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; password<br />);</p>
<div class="description">
<p></p>
</div>
<p class="footer">POCO C++ Libraries 1.3.6-all<br />
Copyright &copy; 2009, <a href="http://pocoproject.org/" target="_blank">Applied Informatics Software Engineering GmbH and Contributors</a></p>

</div>
</body>
</html>