OpenCPN Partial API docs
Loading...
Searching...
No Matches
msg.h
Go to the documentation of this file.
1
2// Name: msg.h
3// Purpose: wxMailMessage
4// Author: Julian Smart
5// Modified by:
6// Created: 2001-08-21
7// Copyright: (c) Julian Smart
8// Licence: wxWindows licence
10
31#ifndef WX_MSG_H_
32#define WX_MSG_H_
33
34#define WXDLLIMPEXP_NETUTILS
35#define WXDLLIMPEXP_DATA_NETUTILS(type) type
36
37/*
38 * wxMailMessage
39 * Encapsulates an email message
40 */
41
42class WXDLLIMPEXP_NETUTILS wxMailMessage {
43public:
44 // A common usage
45 wxMailMessage(const wxString& subject, const wxString& to,
46 const wxString& body, const wxString& from = wxEmptyString,
47 const wxString& attachment = wxEmptyString,
48 const wxString& attachmentTitle = wxEmptyString) {
49 m_to.Add(to);
50 m_subject = subject;
51 m_body = body;
52 m_from = from;
53 if (!attachment.IsEmpty()) {
54 m_attachments.Add(attachment);
55 m_attachmentTitles.Add(attachmentTitle);
56 }
57 }
58
59 wxMailMessage() = default;
60
62
63 void AddTo(const wxString& to) { m_to.Add(to); }
64 void AddCc(const wxString& cc) { m_cc.Add(cc); }
65 void AddBcc(const wxString& bcc) { m_bcc.Add(bcc); }
66 void AddAttachment(const wxString& attach,
67 const wxString& title = wxEmptyString) {
68 m_attachments.Add(attach);
69 m_attachmentTitles.Add(title);
70 }
71
72 void SetSubject(const wxString& subject) { m_subject = subject; }
73 void SetBody(const wxString& body) { m_body = body; }
74 void SetFrom(const wxString& from) { m_from = from; }
75
76public:
77 wxArrayString m_to; // The To: Recipients
78 wxString m_from; // The From: email address (optional)
79 wxArrayString m_cc; // The CC: Recipients
80 wxArrayString m_bcc; // The BCC Recipients
81 wxString m_subject; // The Subject of the message
82 wxString m_body; // The Body of the message
83 wxArrayString m_attachments; // Files to attach to the email
84 wxArrayString
85 m_attachmentTitles; // Titles to use for the email file attachments
86};
87
88#endif // WX_MSG_H_