1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxMailMessage
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #ifdef WXMAKINGDLL_NETUTILS
16 #define WXDLLIMPEXP_NETUTILS WXEXPORT
17 #define WXDLLIMPEXP_DATA_NETUTILS(type) WXEXPORT type
18 #elif defined(WXUSINGDLL)
19 #define WXDLLIMPEXP_NETUTILS WXIMPORT
20 #define WXDLLIMPEXP_DATA_NETUTILS(type) WXIMPORT type
21 #else // not making nor using DLL
22 #define WXDLLIMPEXP_NETUTILS
23 #define WXDLLIMPEXP_DATA_NETUTILS(type) type
29 * Encapsulates an email message
32 class WXDLLIMPEXP_NETUTILS wxMailMessage
37 wxMailMessage(const wxString
& subject
, const wxString
& to
,
38 const wxString
& body
, const wxString
& from
= wxEmptyString
,
39 const wxString
& attachment
= wxEmptyString
,
40 const wxString
& attachmentTitle
= wxEmptyString
)
46 if (!attachment
.IsEmpty())
48 m_attachments
.Add(attachment
);
49 m_attachmentTitles
.Add(attachmentTitle
);
57 void AddTo(const wxString
& to
) { m_to
.Add(to
); }
58 void AddCc(const wxString
& cc
) { m_cc
.Add(cc
); }
59 void AddBcc(const wxString
& bcc
) { m_bcc
.Add(bcc
); }
60 void AddAttachment(const wxString
& attach
, const wxString
& title
= wxEmptyString
)
61 { m_attachments
.Add(attach
); m_attachmentTitles
.Add(title
); }
63 void SetSubject(const wxString
& subject
) { m_subject
= subject
; }
64 void SetBody(const wxString
& body
) { m_body
= body
; }
65 void SetFrom(const wxString
& from
) { m_from
= from
; }
68 wxArrayString m_to
; //The To: Recipients
69 wxString m_from
; //The From: email address (optional)
70 wxArrayString m_cc
; //The CC: Recipients
71 wxArrayString m_bcc
; //The BCC Recipients
72 wxString m_subject
; //The Subject of the message
73 wxString m_body
; //The Body of the message
74 wxArrayString m_attachments
; //Files to attach to the email
75 wxArrayString m_attachmentTitles
; //Titles to use for the email file attachments