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// RCS-ID: $Id: msg.h 28475 2004-07-25 15:44:47Z VZ $
8// Copyright: (c) Julian Smart
9// Licence: wxWindows licence
11
29#ifndef _WX_MSG_H_
30#define _WX_MSG_H_
31
32#define WXDLLIMPEXP_NETUTILS
33#define WXDLLIMPEXP_DATA_NETUTILS(type) type
34
35/*
36 * wxMailMessage
37 * Encapsulates an email message
38 */
39
40class WXDLLIMPEXP_NETUTILS wxMailMessage {
41public:
42 // A common usage
43 wxMailMessage(const wxString& subject, const wxString& to,
44 const wxString& body, const wxString& from = wxEmptyString,
45 const wxString& attachment = wxEmptyString,
46 const wxString& attachmentTitle = wxEmptyString) {
47 m_to.Add(to);
48 m_subject = subject;
49 m_body = body;
50 m_from = from;
51 if (!attachment.IsEmpty()) {
52 m_attachments.Add(attachment);
53 m_attachmentTitles.Add(attachmentTitle);
54 }
55 }
56
57 wxMailMessage() {};
58
60
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,
65 const wxString& title = wxEmptyString) {
66 m_attachments.Add(attach);
67 m_attachmentTitles.Add(title);
68 }
69
70 void SetSubject(const wxString& subject) { m_subject = subject; }
71 void SetBody(const wxString& body) { m_body = body; }
72 void SetFrom(const wxString& from) { m_from = from; }
73
74public:
75 wxArrayString m_to; // The To: Recipients
76 wxString m_from; // The From: email address (optional)
77 wxArrayString m_cc; // The CC: Recipients
78 wxArrayString m_bcc; // The BCC Recipients
79 wxString m_subject; // The Subject of the message
80 wxString m_body; // The Body of the message
81 wxArrayString m_attachments; // Files to attach to the email
82 wxArrayString
83 m_attachmentTitles; // Titles to use for the email file attachments
84};
85
86#endif // _WX_MSG_H_