Mail object used for BpsSmtp. More...
#include <bpsmail.h>
Public Member Functions | |
| void | addBccRecipient (const QString &aEmail) |
| Add "BCC" recipient. More... | |
| void | addCcRecipient (const QString &aEmail, const QString &aName=QString()) |
| Add a "CC" recipient. More... | |
| void | addFile (const QString &aFile) |
| Adds a file to attach to the email. More... | |
| void | addImage (const QString &aFile) |
| Adds an image to embedd for use in HTML. More... | |
| void | addToRecipient (const QString &aEmail, const QString &aName=QString()) |
| Add a "TO" recipient. More... | |
| QStringList | bccRecipients () const |
| Get "BCC" recipients email addresses. More... | |
| BpsMail () | |
| Constructor for the BpsMail object. | |
| BpsMail (const BpsMail &aOther) | |
| The copy constructor. More... | |
| QList< QPair< QString, QString > > | ccRecipients () const |
| Get "CC" recipients email addresses and names. More... | |
| void | clear () |
| Clear the object to start over. | |
| QStringList | files () const |
| QString | html () const |
| QStringList | images () const |
| BpsMail & | operator= (const BpsMail &aOther) |
| Assign value from an other mail object. More... | |
| QString | senderEmail () const |
| Get sender email address. More... | |
| QString | senderName () const |
| Get sender display name. More... | |
| void | setBccRecipients (const QStringList &aRecipients) |
| Set the list of "BCC" recipients. More... | |
| void | setCcRecipients (const QList< QPair< QString, QString >> &aRecipients) |
| Set the list of "CC" recipients. More... | |
| void | setFiles (const QStringList &aFiles) |
| Sets the list of files to attach to the email. More... | |
| void | setHtml (const QString &aHtml) |
| Set the message body HTML. More... | |
| void | setImages (const QStringList &aFiles) |
| Sets the list of images to embedd for use in HTML. More... | |
| void | setSender (const QString &aEmail, const QString &aName=QString()) |
| Set email address and name of sender. More... | |
| void | setSubject (const QString &aSubject) |
| Set the subject. More... | |
| void | setText (const QString &aText) |
| Set the message body text. More... | |
| void | setToRecipients (const QList< QPair< QString, QString >> &aRecipients) |
| Set the list of "TO" recipients. More... | |
| QString | subject () const |
| QString | text () const |
| QList< QPair< QString, QString > > | toRecipients () const |
| Get "TO" recipients. More... | |
Mail object used for BpsSmtp.
| BpsMail::BpsMail | ( | const BpsMail & | aOther | ) |
The copy constructor.
| aOther | The other object to copy from. |
| void BpsMail::addBccRecipient | ( | const QString & | aEmail | ) |
Add "BCC" recipient.
| aEmail | The plain email address. Example: "johndoe@sample.com". |
Add a "CC" recipient.
| aEmail | The plain email address. Example: "johndoe@sample.com". |
| aName | The optional name to be displayed. Example: "John Doe". |
| void BpsMail::addFile | ( | const QString & | aFile | ) |
Adds a file to attach to the email.
The file name/path shall be given either as absolute path, or relative to the current directory.
| aFile | Name/oath of the file to attach. |
| void BpsMail::addImage | ( | const QString & | aFile | ) |
Adds an image to embedd for use in HTML.
The first inline image is addressed as "cid:image1", the second as "cid:image2" etc.
| aFile | The image file to embedd. |
Add a "TO" recipient.
| aEmail | The plain email address. Example: "johndoe@sample.com". |
| aName | The optional name to be displayed. Example: "John Doe". |
| QStringList BpsMail::bccRecipients | ( | ) | const |
Get "BCC" recipients email addresses.
The recipients are returned as a list plain email addresses.
Get "CC" recipients email addresses and names.
Each recipient is returned as a list of one or two strings. The first string is the email address. If the list has two strings, the second is the display name.
| QStringList BpsMail::files | ( | ) | const |
| QString BpsMail::html | ( | ) | const |
| QStringList BpsMail::images | ( | ) | const |
Assign value from an other mail object.
| aOther | The other object to copy. |
| QString BpsMail::senderEmail | ( | ) | const |
Get sender email address.
| QString BpsMail::senderName | ( | ) | const |
Get sender display name.
| void BpsMail::setBccRecipients | ( | const QStringList & | aRecipients | ) |
Set the list of "BCC" recipients.
Any previous "BCC" recipients are replaced.
| aRecipients | The list of plain email addresses. |
Set the list of "CC" recipients.
The recipients are given as a list of pairs with two strings. The first string is the email address, the second is the display name and might be empty. Any previous "CC" recipients are replaced.
| aRecipients | The list of recipients. |
| void BpsMail::setFiles | ( | const QStringList & | aFiles | ) |
Sets the list of files to attach to the email.
Any previous list of files is replaced. The file name/path shall be given either as absolute path, or relative to the current directory.
| aFiles | The list of files to attach. |
| void BpsMail::setHtml | ( | const QString & | aHtml | ) |
Set the message body HTML.
The plain text will automatically be extracted from the given HTML. If you want to set a different plain text, call setText after setHtml.
| aHtml | The message body HTML. |
| void BpsMail::setImages | ( | const QStringList & | aFiles | ) |
Sets the list of images to embedd for use in HTML.
Any previous list of images is replaced. The first inline image is addressed as "cid:image1", the second as "cid:image2" etc.
| aFiles | The list of image files to embedd. |
Set email address and name of sender.
| aEmail | The plain email address. Example: "johndoe@sample.com". |
| aName | The sender name to be displayed. Example: "John Doe". |
| void BpsMail::setSubject | ( | const QString & | aSubject | ) |
Set the subject.
| aSubject | The subject text. |
| void BpsMail::setText | ( | const QString & | aText | ) |
Set the message body text.
| aText | The message body as plain text. |
Set the list of "TO" recipients.
The recipients are given as a list of pairs with two strings. The first string is the email address, the second is the display name and might be empty. Any previous "TO" recipients are replaced.
| aRecipients | The list of recipients. |
| QString BpsMail::subject | ( | ) | const |
| QString BpsMail::text | ( | ) | const |
Get "TO" recipients.
The recipients are returned as a list of pairs with two strings. The first string is the email address, the second is the display name and might be empty.