#include <writemime.h>
Public Types | |
enum | recpt_type { TO = 0, CC = 1, BCC = 2 } |
Destination address types. | |
Public Member Functions | |
virtual const char * | format ()=0 |
return 0-terminated formatted message text | |
virtual int | addRecipient (const char *official, const char *nick=0, recpt_type tp=TO) |
Add recipient to one of the recipient lists. | |
virtual int | parseAddRecipients (const char *in, recpt_type tp=TO) |
Parse a user-written recipient string and add recipients. | |
virtual const char ** | getRecipients () |
Return recipient list as a C string array. | |
virtual int | setSubject (const char *subject) |
Set the subject field value. | |
virtual int | setFrom (const Recipient &from) |
Set the 'From' field value. | |
Protected Member Functions | |
void | setRecipientHeaders () |
Protected Attributes | |
list< Recipient > | to |
list< Recipient > | cc |
list< Recipient > | bcc |
list< Recipient > * | recptlists [3] |
Static Protected Attributes | |
static const char * | recpth [3] = {"To", "Cc", "Bcc"} |
int WriteMime::Message::addRecipient | ( | const char * | official, | |
const char * | nick = 0 , |
|||
recpt_type | tp = TO | |||
) | [virtual] |
Add recipient to one of the recipient lists.
official | will be placed inside <>. | |
nick | will be printed before the formal address. | |
tp | defines what kind of recipient this is (to, cc, bcc). |
Referenced by parseAddRecipients().
const char ** WriteMime::Message::getRecipients | ( | ) | [virtual] |
Return recipient list as a C string array.
Referenced by WriteMime::sendmail().
int WriteMime::Message::parseAddRecipients | ( | const char * | in, | |
recpt_type | tp = TO | |||
) | [virtual] |
Parse a user-written recipient string and add recipients.
The purpose of this routine is to help a program interpret text cut-and-pasted by a user into a Gui text field. This has little to do with rfc822 and does not even try to pretend to support everything that could get into an address string.
The function *CAN* fail if the syntax is bad (ie: unbalanced '<').
It supports comma-separated lists of addresses, where each address can contain comments '(bla)', and look like a simple address (dockes or dockes@my.dom.ain), or a full name + official address: jean-francois dockes <dockes>
The function also supports quoting with double-quotes, for exemple to avoid comma interpretation inside the full name part.
Exemple of a list of 2 addresses:
in | the string to be parsed | |
tp | defines the target recipient list (to, cc, or bcc). |
References addRecipient(), and WriteMime::Entity::seterror().