PTLib
Version 2.14.3
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
mail.h
Go to the documentation of this file.
1
/*
2
* mail.h
3
*
4
* Electronic Mail abstraction class.
5
*
6
* Portable Windows Library
7
*
8
* Copyright (c) 1993-1998 Equivalence Pty. Ltd.
9
*
10
* The contents of this file are subject to the Mozilla Public License
11
* Version 1.0 (the "License"); you may not use this file except in
12
* compliance with the License. You may obtain a copy of the License at
13
* http://www.mozilla.org/MPL/
14
*
15
* Software distributed under the License is distributed on an "AS IS"
16
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17
* the License for the specific language governing rights and limitations
18
* under the License.
19
*
20
* The Original Code is Portable Windows Library.
21
*
22
* The Initial Developer of the Original Code is Equivalence Pty. Ltd.
23
*
24
* Portions are Copyright (C) 1993 Free Software Foundation, Inc.
25
* All Rights Reserved.
26
*
27
* Contributor(s): ______________________________________.
28
*
29
* $Revision: 28729 $
30
* $Author: csoutheren $
31
* $Date: 2013-01-02 10:20:47 +1100 (Wed, 02 Jan 2013) $
32
*/
33
34
#ifndef PTLIB_MAIL_H
35
#define PTLIB_MAIL_H
36
37
#ifdef P_USE_PRAGMA
38
#pragma interface
39
#endif
40
41
#if defined(_WIN32) && !defined(_WIN64)
42
43
# if _MSC_VER < 1700
44
45
# ifndef P_HAS_MAPI
46
# define P_HAS_MAPI 1
47
# endif
48
49
# ifndef P_HAS_CMC
50
# define P_HAS_CMC 1
51
# endif
52
53
# endif
54
55
# if P_HAS_MAPI
56
# include <mapi.h>
57
# endif
58
59
# if P_HAS_CMC
60
# include <xcmc.h>
61
# endif
62
63
#endif // _WIN32
64
65
68
class
PMail
:
public
PObject
69
{
70
PCLASSINFO(
PMail
,
PObject
);
71
72
public
:
77
PMail
();
78
82
PMail
(
83
const
PString
& username,
84
const
PString
& password
85
);
86
90
PMail
(
91
const
PString
& username,
92
const
PString
& password,
93
const
PString
& service
98
);
99
100
101
virtual
~PMail
();
102
/* Destroy the mail session, logging off the mail system if necessary.
103
*/
105
113
PBoolean
LogOn
(
114
const
PString
& username,
115
const
PString
& password
116
);
117
123
PBoolean
LogOn
(
124
const
PString
& username,
125
const
PString
& password,
126
const
PString
& service
131
);
132
138
virtual
PBoolean
LogOff
();
139
145
PBoolean
IsLoggedOn
()
const
;
147
156
PBoolean
SendNote
(
157
const
PString
& recipient,
158
const
PString
& subject,
159
const
char
* body
160
);
161
168
PBoolean
SendNote
(
169
const
PString
& recipient,
170
const
PString
& subject,
171
const
char
* body,
172
const
PStringList
& attachments
174
);
175
182
PBoolean
SendNote
(
183
const
PString
& recipient,
184
const
PStringList
& carbonCopies,
185
const
PStringList
& blindCarbons,
186
const
PString
& subject,
187
const
char
* body,
188
const
PStringList
& attachments
190
);
192
200
PStringArray
GetMessageIDs
(
201
PBoolean
unreadOnly =
true
202
);
203
205
struct
Header
{
207
PString
subject
;
209
PString
originatorName
;
211
PString
originatorAddress
;
213
PTime
received
;
214
};
215
221
PBoolean
GetMessageHeader
(
222
const
PString
&
id
,
223
Header
& hdrInfo
224
);
225
242
PBoolean
GetMessageBody
(
243
const
PString
&
id
,
244
PString
& body,
245
PBoolean
markAsRead =
false
246
);
247
253
PBoolean
GetMessageAttachments
(
254
const
PString
&
id
,
255
PStringArray
& filenames,
256
PBoolean
includeBody =
false
,
257
PBoolean
markAsRead =
false
258
);
259
265
PBoolean
MarkMessageRead
(
266
const
PString
&
id
267
);
268
274
PBoolean
DeleteMessage
(
275
const
PString
&
id
276
);
278
281
282
enum
LookUpResult
{
284
UnknownUser
,
286
AmbiguousUser
,
288
ValidUser
,
290
LookUpError
291
};
292
299
LookUpResult
LookUp
(
300
const
PString
& name,
301
PString
* fullName = NULL
305
);
307
316
int
GetErrorCode
()
const
;
317
324
PString
GetErrorText
()
const
;
326
327
328
protected
:
329
void
Construct
();
330
// Common construction code.
331
333
PBoolean
loggedOn
;
334
335
336
// Include platform dependent part of class
337
#ifdef _WIN32
338
#include "msos/ptlib/mail.h"
339
#else
340
#include "unix/ptlib/mail.h"
341
#endif
342
};
343
344
345
#endif // PTLIB_MAIL_H
346
347
348
// End Of File ///////////////////////////////////////////////////////////////
include
ptlib
mail.h
Generated on Fri Oct 10 2014 21:15:13 for PTLib by
1.8.3.1