## GMimeTextPart

GMimeTextPart — textual MIME parts

## Functions

GMimeTextPart * | g_mime_text_part_new ()
GMimeTextPart * | g_mime_text_part_new_with_subtype ()
const char * | g_mime_text_part_get_charset ()
void | g_mime_text_part_set_charset ()
char * | g_mime_text_part_get_text ()
void | g_mime_text_part_set_text ()

## Types and Values

struct | GMimeTextPart

## Object Hierarchy

        GObject
        ╰── GMimeObject
            ╰── GMimePart
                ╰── GMimeTextPart

## Description

A GMimeTextPart represents any text MIME part.

## Functions

### g_mime_text_part_new ()

    GMimeTextPart *
    g_mime_text_part_new (void);

Creates a new text MIME part object with a default content-type of text/plain.

#### Returns

an empty MIME Part object with a default content-type of text/plain.

### g_mime_text_part_new_with_subtype ()

    GMimeTextPart *
    g_mime_text_part_new_with_subtype (const char *subtype);

Creates a new text MIME part with a sepcified subtype.

#### Parameters

subtype | textual subtype string |

#### Returns

an empty text MIME part object with the specified subtype.

### g_mime_text_part_get_charset ()

    const char *
    g_mime_text_part_get_charset (GMimeTextPart *mime_part);

Gets the value of the charset parameter on the Content-Type header.

#### Parameters

mime_part | a GMimeTextPart |

#### Returns

the value of the charset parameter or `NULL` if unavailable.

### g_mime_text_part_set_charset ()

    void
    g_mime_text_part_set_charset (GMimeTextPart *mime_part,
                                  const char *charset);

Sets the charset parameter on the Content-Type header to the specified value.

#### Parameters

mime_part | a GMimeTextPart |
charset | the name of the charset |

### g_mime_text_part_get_text ()

    char *
    g_mime_text_part_get_text (GMimeTextPart *mime_part);

Gets the text content of the `mime_part` as a string.

#### Parameters

mime_part | a GMimeTextPart |

#### Returns

a newly allocated string containing the utf-8 encoded text content.

### g_mime_text_part_set_text ()

    void
    g_mime_text_part_set_text (GMimeTextPart *mime_part,
                               const char *text);

Sets the specified text as the content and updates the charset parameter on the Content-Type header.

#### Parameters

mime_part | a GMimeTextPart |
text | the text in utf-8 |

## Types and Values

### struct GMimeTextPart

    struct GMimeTextPart;

A text MIME part object.

#### Members