SnCore!

QuotedPrintable Class Reference

Based on Bill Gearhart http://www.aspemporium.com/classes.aspx?cid=4 More...

List of all members.


Static Public Member Functions

static string Fold (string s)
static string Encode (string toencode)
 Encodes a very large string into the Quoted-Printable encoding for transmission via SMTP.
static string Encode (string toencode, int charsperline)
 Encodes a very large string into the Quoted-Printable encoding for transmission via SMTP.
static string EncodeSmall (string s)
 Encodes a small string into the Quoted-Printable encoding for transmission via SMTP. The string is not split into lines of X characters like the string that the Encode method returns.
static string FormatEncodedString (string s, int maxcharlen)
 Formats a quoted-printable string into lines equal to maxcharlen, following all protocol rules such as byte stuffing. This method is called automatically by the Encode method and the EncodeFile method.
static string FormatEncodedString (string s, int maxcharlen, string linesep)
static string Decode (string encoded)
 Decodes a Quoted-Printable string of any size into it's original text.

Public Attributes

const int RFC_1521_MAX_CHARS_PER_LINE = 75
 Gets the maximum number of characters per quoted-printable line as defined in the RFC minus 1 to allow for the = character (soft line break).

Detailed Description

Based on Bill Gearhart http://www.aspemporium.com/classes.aspx?cid=4

Member Function Documentation

static string Encode ( string  toencode  )  [static]

Encodes a very large string into the Quoted-Printable encoding for transmission via SMTP.

Parameters:
toencode the very large string to encode
Returns:
The Quoted-Printable encoded string
Exceptions:
ObjectDisposedException A problem occurred while attempting to read the encoded string.
OutOfMemoryException There is insufficient memory to allocate a buffer for the returned string.
ArgumentNullException A string is passed in as a null reference.
IOException An I/O error occurs, such as the stream being closed.
ArgumentOutOfRangeException The charsperline argument is less than or equal to 0.

This method encodes a large string into the quoted-printable encoding and then properly formats it into lines of 76 characters using the FormatEncodedString method.

static string Encode ( string  toencode,
int  charsperline 
) [static]

Encodes a very large string into the Quoted-Printable encoding for transmission via SMTP.

Parameters:
toencode the very large string to encode
charsperline the number of chars per line after encoding
Returns:
The Quoted-Printable encoded string
Exceptions:
ObjectDisposedException A problem occurred while attempting to read the encoded string.
OutOfMemoryException There is insufficient memory to allocate a buffer for the returned string.
ArgumentNullException A string is passed in as a null reference.
IOException An I/O error occurs, such as the stream being closed.
ArgumentOutOfRangeException The charsperline argument is less than or equal to 0.

This method encodes a large string into the quoted-printable encoding and then properly formats it into lines of charsperline characters using the FormatEncodedString method.

static string EncodeSmall ( string  s  )  [static]

Encodes a small string into the Quoted-Printable encoding for transmission via SMTP. The string is not split into lines of X characters like the string that the Encode method returns.

Parameters:
s The string to encode.
Returns:
The Quoted-Printable encoded string
Exceptions:
ArgumentNullException A string is passed in as a null reference.

This method encodes a small string into the quoted-printable encoding. The resultant encoded string has NOT been separated into lined results using the FormatEncodedString method.

static string FormatEncodedString ( string  s,
int  maxcharlen 
) [static]

Formats a quoted-printable string into lines equal to maxcharlen, following all protocol rules such as byte stuffing. This method is called automatically by the Encode method and the EncodeFile method.

Parameters:
qpstr the quoted-printable encoded string.
maxcharlen the number of chars per line after encoding.
Returns:
The properly formatted Quoted-Printable encoded string in lines of 76 characters as defined by the RFC.
Exceptions:
ArgumentNullException A string is passed in as a null reference.
IOException An I/O error occurs, such as the stream being closed.

Formats a quoted-printable encoded string into lines of maxcharlen characters for transmission via SMTP.

static string Decode ( string  encoded  )  [static]

Decodes a Quoted-Printable string of any size into it's original text.

Parameters:
encoded The encoded string to decode.
Returns:
The decoded string.
Exceptions:
ArgumentNullException A string is passed in as a null reference.

Decodes a quoted-printable encoded string into a string of unencoded text of any size.


Member Data Documentation

Gets the maximum number of characters per quoted-printable line as defined in the RFC minus 1 to allow for the = character (soft line break).

(Soft Line Breaks): The Quoted-Printable encoding REQUIRES that encoded lines be no more than 76 characters long. If longer lines are to be encoded with the Quoted-Printable encoding, 'soft' line breaks must be used. An equal sign as the last character on a encoded line indicates such a non-significant ('soft') line break in the encoded text.


The documentation for this class was generated from the following file:
  • QuotedPrintable.cs
© Vestris Inc., 2006-2007, All Rights Reserved | SnCore | Wed Mar 5 09:56:26 2008 | Doxygen 1.5.4