BPS C++ API  2.24.4
bpsmail.h
Go to the documentation of this file.
1 
4 #ifndef BPSMAIL_H
5 #define BPSMAIL_H
6 
7 #include "bpscore_global.h"
8 #include <QPair>
9 #include <QStringList>
10 
15 {
17 
18 public:
23 
28  BpsMail(const BpsMail& aOther);
29 
30  virtual ~BpsMail();
31 
37  BpsMail& operator=(const BpsMail& aOther);
38 
42  void clear();
43 
49  void setSender(const QString& aEmail, const QString& aName = QString());
50 
56 
62 
68  void addToRecipient(const QString& aEmail, const QString& aName = QString());
69 
77  void setToRecipients(const QList<QPair<QString,QString>>& aRecipients);
78 
86 
92  void addCcRecipient(const QString& aEmail, const QString& aName = QString());
93 
101  void setCcRecipients(const QList<QPair<QString,QString>>& aRecipients);
102 
111 
116  void addBccRecipient(const QString& aEmail);
117 
123  void setBccRecipients(const QStringList& aRecipients);
124 
131 
136  void setSubject(const QString& aSubject);
137 
141  QString subject() const;
142 
147  void setText(const QString& aText);
148 
152  QString text() const;
153 
160  void setHtml(const QString& aHtml);
161 
165  QString html() const;
166 
172  void addFile(const QString& aFile);
173 
180  void setFiles(const QStringList& aFiles);
181 
186 
192  void addImage(const QString& aFile);
193 
200  void setImages(const QStringList& aFiles);
201 
206 };
207 
208 #endif // BPSMAIL_H
Public include file for BPS CORE library macros.
#define BPSCORE_EXPORT
Declare class to be an import from the shared library.
Definition: bpscore_global.h:22
#define BPS_PRIVATE(Class)
Declare pointer to private object in a public class.
Definition: bpsglobals.h:102
Mail object used for BpsSmtp.
Definition: bpsmail.h:15
void setSender(const QString &aEmail, const QString &aName=QString())
Set email address and name of sender.
QStringList images() const
void setHtml(const QString &aHtml)
Set the message body HTML.
BpsMail & operator=(const BpsMail &aOther)
Assign value from an other mail object.
QString subject() const
void setImages(const QStringList &aFiles)
Sets the list of images to embedd for use in HTML.
void setSubject(const QString &aSubject)
Set the subject.
QString html() const
QList< QPair< QString, QString > > ccRecipients() const
Get "CC" recipients email addresses and names.
void setText(const QString &aText)
Set the message body text.
BpsMail(const BpsMail &aOther)
The copy constructor.
QStringList bccRecipients() const
Get "BCC" recipients email addresses.
void addToRecipient(const QString &aEmail, const QString &aName=QString())
Add a "TO" recipient.
void setToRecipients(const QList< QPair< QString, QString >> &aRecipients)
Set the list of "TO" recipients.
void addBccRecipient(const QString &aEmail)
Add "BCC" recipient.
QStringList files() const
void clear()
Clear the object to start over.
void setBccRecipients(const QStringList &aRecipients)
Set the list of "BCC" recipients.
void addImage(const QString &aFile)
Adds an image to embedd for use in HTML.
void setCcRecipients(const QList< QPair< QString, QString >> &aRecipients)
Set the list of "CC" recipients.
void addCcRecipient(const QString &aEmail, const QString &aName=QString())
Add a "CC" recipient.
QString senderName() const
Get sender display name.
QList< QPair< QString, QString > > toRecipients() const
Get "TO" recipients.
QString text() const
QString senderEmail() const
Get sender email address.
void addFile(const QString &aFile)
Adds a file to attach to the email.
BpsMail()
Constructor for the BpsMail object.
void setFiles(const QStringList &aFiles)
Sets the list of files to attach to the email.