1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxMailMessage
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #if defined(__GNUG__) && !defined(__APPLE__)
13 #pragma interface "msg.h"
19 #ifdef WXMAKINGDLL_NETUTILS
20 #define WXDLLIMPEXP_NETUTILS WXEXPORT
21 #define WXDLLIMPEXP_DATA_NETUTILS(type) WXEXPORT type
22 #elif defined(WXUSINGDLL)
23 #define WXDLLIMPEXP_NETUTILS WXIMPORT
24 #define WXDLLIMPEXP_DATA_NETUTILS(type) WXIMPORT type
25 #else // not making nor using DLL
26 #define WXDLLIMPEXP_NETUTILS
27 #define WXDLLIMPEXP_DATA_NETUTILS(type) type
33 * Encapsulates an email message
36 class WXDLLIMPEXP_NETUTILS wxMailMessage
41 wxMailMessage(const wxString
& subject
, const wxString
& to
,
42 const wxString
& body
, const wxString
& from
= wxEmptyString
,
43 const wxString
& attachment
= wxEmptyString
,
44 const wxString
& attachmentTitle
= wxEmptyString
)
50 if (!attachment
.IsEmpty())
52 m_attachments
.Add(attachment
);
53 m_attachmentTitles
.Add(attachmentTitle
);
61 void AddTo(const wxString
& to
) { m_to
.Add(to
); }
62 void AddCc(const wxString
& cc
) { m_cc
.Add(cc
); }
63 void AddBcc(const wxString
& bcc
) { m_bcc
.Add(bcc
); }
64 void AddAttachment(const wxString
& attach
, const wxString
& title
= wxEmptyString
)
65 { m_attachments
.Add(attach
); m_attachmentTitles
.Add(title
); }
67 void SetSubject(const wxString
& subject
) { m_subject
= subject
; }
68 void SetBody(const wxString
& body
) { m_body
= body
; }
69 void SetFrom(const wxString
& from
) { m_from
= from
; }
72 wxArrayString m_to
; //The To: Recipients
73 wxString m_from
; //The From: email address (optional)
74 wxArrayString m_cc
; //The CC: Recipients
75 wxArrayString m_bcc
; //The BCC Recipients
76 wxString m_subject
; //The Subject of the message
77 wxString m_body
; //The Body of the message
78 wxArrayString m_attachments
; //Files to attach to the email
79 wxArrayString m_attachmentTitles
; //Titles to use for the email file attachments