WriteMime Namespace Reference

Mime message encoding. More...


Classes

class  HeaderFieldParam
class  HeaderField
class  Entity
 virtual base class for Mime entities. More...
class  DiscreteEntity
 A DiscreteEntity represents a MIME entity with a discrete media type, it can be used either as the base for a simple message or as a part of a CompositeEntity. More...
class  CompositeEntity
 The CompositeEntity class is used to represent MIME entities with a composite media type, which will typically have multiple body parts. More...
class  Recipient
class  Message
 Pure virtual base class for email messages. More...
class  SimpleMessage
 A simple email message is a discrete MIME entity plus email-specific headers. More...
class  CompositeMessage
 A composite message is a composite entity plus email-specific headers. More...

Enumerations

enum  parseRecptsState { PST_BASE, PST_QUOTE, PST_COMMENT, PST_OFFICIAL }

Functions

char * base64Encode (const char *from, int fromlen, int *tolen, int ll=54)
 Encode input buffer to base64 format.
char * qpEncode (const char *from, int fromlen, int *tolen)
 Encode input buffer to quoted-printable format.
char * readFile (const char *fname, int *outlen)
 Miscellaneous utilities Read file into memory.
char * base64EncodeFile (const char *fname, int *outlen)
 Encode file to base64 format.
int sendmail (Message *msg)
 Execute sendmail to send message.


Detailed Description

Mime message encoding.


Function Documentation

char * WriteMime::base64Encode ( const char *  from,
int  fromlen,
int *  tolen,
int  ll 
)

Encode input buffer to base64 format.

Parameters:
ll Output line length in terms of input chars. 54 input bytes -> 72 output
from input buffer.
fromlen input buffer size.
tolen returns the generated data size, not including the final 0
ll Output line length in terms of input chars. 54 input bytes -> 72 output
Returns:
Encoded buffer. The memory is allocated through malloc and should be freed by the caller. The buffer has a final 0 byte.

Referenced by base64EncodeFile(), and WriteMime::DiscreteEntity::setBody().

char * WriteMime::base64EncodeFile ( const char *  fname,
int *  outlen 
)

Encode file to base64 format.

Parameters:
fname the file name
outlen the encoded buffer size, not including the final 0
Returns:
Encoded buffer. The memory is allocated through malloc and should be freed by the caller. The buffer has a final 0 byte.

References base64Encode(), and readFile().

Referenced by WriteMime::DiscreteEntity::setBodyAttach().

char * WriteMime::qpEncode ( const char *  from,
int  fromlen,
int *  tolen 
)

Encode input buffer to quoted-printable format.

Parameters:
from input buffer.
fromlen input buffer size.
tolen returns the generated data size, not including the final 0
Returns:
Encoded buffer. The memory is allocated through malloc and should be freed by the caller. The buffer has a final 0 byte.

Referenced by WriteMime::DiscreteEntity::setBody().

char * WriteMime::readFile ( const char *  fname,
int *  outlen 
)

Miscellaneous utilities Read file into memory.

Parameters:
fname file name
outlen returns the file/output buffer size
Returns:
A buffer holding the raw file data, which should be freed by the caller.

Referenced by base64EncodeFile().

int WriteMime::sendmail ( Message *  msg  ) 

Execute sendmail to send message.

Extracts the complete list of recipients and executes sendmail, like '/usr/sbin/sendmail -i -- [recipient list]'.

The default program to be executed is defined by the SENDMAIL_PROG preprocessor variable (default: /usr/sbin/sendmail). This can be overridden either by defining the variable at compile time, or, at run time through an environment variable: WRITEMIME_SENDMAIL_PROG
Parameters:
msg the message to send. Address lists for sendmail execution will be generated from the to, cc, and bcc lists.
Returns:
0 for success, -1 for failure.

References WriteMime::Message::format(), WriteMime::Message::getRecipients(), and WriteMime::Entity::seterror().


Generated on Fri Feb 6 11:53:41 2009 for WriteMIME by  doxygen 1.5.7.1