2001-08-21 05:11:20 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: msg.h
|
|
|
|
// Purpose: wxMailMessage
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 2001-08-21
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Julian Smart
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2002-09-07 08:28:46 -04:00
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
2001-08-21 05:11:20 -04:00
|
|
|
#pragma interface "msg.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _WX_MSG_H_
|
|
|
|
#define _WX_MSG_H_
|
|
|
|
|
2003-08-03 13:11:53 -04:00
|
|
|
#ifdef WXMAKINGDLL_NETUTILS
|
|
|
|
#define WXDLLIMPEXP_NETUTILS WXEXPORT
|
|
|
|
#define WXDLLIMPEXP_DATA_NETUTILS(type) WXEXPORT type
|
|
|
|
#elif defined(WXUSINGDLL)
|
|
|
|
#define WXDLLIMPEXP_NETUTILS WXIMPORT
|
|
|
|
#define WXDLLIMPEXP_DATA_NETUTILS(type) WXIMPORT type
|
|
|
|
#else // not making nor using DLL
|
|
|
|
#define WXDLLIMPEXP_NETUTILS
|
|
|
|
#define WXDLLIMPEXP_DATA_NETUTILS(type) type
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2001-08-21 05:11:20 -04:00
|
|
|
/*
|
|
|
|
* wxMailMessage
|
|
|
|
* Encapsulates an email message
|
|
|
|
*/
|
|
|
|
|
2003-08-03 13:11:53 -04:00
|
|
|
class WXDLLIMPEXP_NETUTILS wxMailMessage
|
2001-08-21 05:11:20 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
// A common usage
|
|
|
|
wxMailMessage(const wxString& subject, const wxString& to,
|
2001-09-06 15:27:52 -04:00
|
|
|
const wxString& body, const wxString& from = wxEmptyString,
|
|
|
|
const wxString& attachment = wxEmptyString,
|
2001-08-21 05:11:20 -04:00
|
|
|
const wxString& attachmentTitle = wxEmptyString)
|
|
|
|
{
|
|
|
|
m_to.Add(to);
|
|
|
|
m_subject = subject;
|
|
|
|
m_body = body;
|
2001-09-06 15:27:52 -04:00
|
|
|
m_from = from;
|
2001-08-21 05:11:20 -04:00
|
|
|
if (!attachment.IsEmpty())
|
|
|
|
{
|
|
|
|
m_attachments.Add(attachment);
|
|
|
|
m_attachmentTitles.Add(attachmentTitle);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
wxMailMessage() {};
|
|
|
|
|
|
|
|
//// Accessors
|
|
|
|
|
|
|
|
void AddTo(const wxString& to) { m_to.Add(to); }
|
|
|
|
void AddCc(const wxString& cc) { m_cc.Add(cc); }
|
|
|
|
void AddBcc(const wxString& bcc) { m_bcc.Add(bcc); }
|
|
|
|
void AddAttachment(const wxString& attach, const wxString& title = wxEmptyString)
|
|
|
|
{ m_attachments.Add(attach); m_attachmentTitles.Add(title); }
|
|
|
|
|
|
|
|
void SetSubject(const wxString& subject) { m_subject = subject; }
|
|
|
|
void SetBody(const wxString& body) { m_body = body; }
|
2001-09-06 15:27:52 -04:00
|
|
|
void SetFrom(const wxString& from) { m_from = from; }
|
2001-08-21 05:11:20 -04:00
|
|
|
|
|
|
|
public:
|
|
|
|
wxArrayString m_to; //The To: Recipients
|
2001-09-06 15:27:52 -04:00
|
|
|
wxString m_from; //The From: email address (optional)
|
2001-08-21 05:11:20 -04:00
|
|
|
wxArrayString m_cc; //The CC: Recipients
|
|
|
|
wxArrayString m_bcc; //The BCC Recipients
|
|
|
|
wxString m_subject; //The Subject of the message
|
|
|
|
wxString m_body; //The Body of the message
|
|
|
|
wxArrayString m_attachments; //Files to attach to the email
|
|
|
|
wxArrayString m_attachmentTitles; //Titles to use for the email file attachments
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _WX_MSG_H_
|
|
|
|
|