forked from bruce-armstrong/pbnismtp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpbnismtp.h
124 lines (98 loc) · 2.06 KB
/
pbnismtp.h
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
#ifndef PBNISMTP_H
#define PBNISMTP_H
#pragma warning(disable:4715 4800)
#define SUCCESSFUL 1
#define INVALIDSENDEREMAIL -1
#define INVALIDRECIPIENTEMAIL -2
#define INVALIDSMTPSERVER -3
#define SMTPCONNECTFAILED -4
#define MESSAGESENDERROR -5
#define MESSAGEBODYERROR -6
#define UNDEFINEDERR -99
#define FALSE 0
#define TRUE 1
class CSMTP : public IPBX_NonVisualObject
{
public:
CSMTP();
virtual ~CSMTP();
PBXRESULT Invoke(
IPB_Session * session,
pbobject obj,
pbmethodID mid,
PBCallInfo * ci
);
protected:
int Send();
void CleanUp();
LPCTSTR Message;
LPCTSTR HTMLMessage;
LPCTSTR SenderEmail;
LPCTSTR RecipientEmail;
LPCTSTR CCRecipientEmail;
LPCTSTR BCCRecipientEmail;
LPCTSTR ReplyToEmail;
LPCTSTR SMTPServer ;
LPCTSTR Subject;
LPCTSTR Attachment ;
LPCTSTR CharSet ;
LPCTSTR Username ;
LPCTSTR Password ;
LPCTSTR HeaderName;
LPCTSTR HeaderValue;
IPB_Value* MessageArg ;
IPB_Value* SenderEmailArg ;
IPB_Value* RecipientEmailArg ;
IPB_Value* CCRecipientEmailArg ;
IPB_Value* BCCRecipientEmailArg ;
IPB_Value* ReplyToEmailArg;
IPB_Value* SMTPServerArg ;
IPB_Value* SubjectArg ;
IPB_Value* AttachmentArg ;
IPB_Value* CharSetArg ;
IPB_Value* UsernameArg ;
IPB_Value* PasswordArg ;
IPB_Value* PriorityArg;
IPB_Value* ReadReceiptArg;
IPB_Value* DeliverReportArg;
IPB_Value* MailerNameArg;
IPB_Value* HeaderArg;
IPB_Session* Session ;
CString LastErrorMsg;
CString MailerName;
int PRIORITY;
bool DELIVERYREPORT;
bool READRECEIPT;
int ErrorMessageBoxesOn ;
bool HTMLBody ;
bool PLAINHTMLBody ;
int Port;
int AuthMethod;
int ConnectType;
class AttachmentBase64
{
public:
LPCSTR Base64;
LPTSTR FileName;
LPTSTR ContentID;
LPTSTR ContentType;
};
class AttachmentFile {
public:
LPTSTR Filename;
LPTSTR ContentID;
LPTSTR ContentType;
};
class CustomHeader {
public:
LPTSTR Name;
LPTSTR Value;
};
std::vector<AttachmentFile> m_AttachmentFile;
std::vector<AttachmentBase64> m_AttachmentBase64;
std::vector<CustomHeader> m_CustomHeaders;
private:
static DWORD m_dwRefCount;
void Destroy() ;
};
#endif