<refentry id="GMimeMessage">
<refmeta>
<refentrytitle role="top_of_page" id="GMimeMessage.top_of_page">GMimeMessage</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>
  GMIME Library
</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GMimeMessage</refname>
<refpurpose>Messages</refpurpose>
</refnamediv>

<refsynopsisdiv id="GMimeMessage.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>enum                <link linkend="GMimeRecipientType">GMimeRecipientType</link>;
                    <link linkend="GMimeMessage-struct">GMimeMessage</link>;
<link linkend="GMimeMessage"><returnvalue>GMimeMessage</returnvalue></link> *      <link linkend="g-mime-message-new">g_mime_message_new</link>                  (<parameter><link linkend="gboolean"><type>gboolean</type></link> pretty_headers</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-message-set-sender">g_mime_message_set_sender</link>           (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *sender</parameter>);
const <link linkend="char"><returnvalue>char</returnvalue></link> *        <link linkend="g-mime-message-get-sender">g_mime_message_get_sender</link>           (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-message-set-reply-to">g_mime_message_set_reply_to</link>         (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *reply_to</parameter>);
const <link linkend="char"><returnvalue>char</returnvalue></link> *        <link linkend="g-mime-message-get-reply-to">g_mime_message_get_reply_to</link>         (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-message-add-recipient">g_mime_message_add_recipient</link>        (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>,
                                                         <parameter><link linkend="GMimeRecipientType"><type>GMimeRecipientType</type></link> type</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *name</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *addr</parameter>);
<link linkend="InternetAddressList"><returnvalue>InternetAddressList</returnvalue></link> * <link linkend="g-mime-message-get-recipients">g_mime_message_get_recipients</link>     (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>,
                                                         <parameter><link linkend="GMimeRecipientType"><type>GMimeRecipientType</type></link> type</parameter>);
<link linkend="InternetAddressList"><returnvalue>InternetAddressList</returnvalue></link> * <link linkend="g-mime-message-get-all-recipients">g_mime_message_get_all_recipients</link> (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-message-set-subject">g_mime_message_set_subject</link>          (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *subject</parameter>);
const <link linkend="char"><returnvalue>char</returnvalue></link> *        <link linkend="g-mime-message-get-subject">g_mime_message_get_subject</link>          (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-message-set-date">g_mime_message_set_date</link>             (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>,
                                                         <parameter><link linkend="time-t"><type>time_t</type></link> date</parameter>,
                                                         <parameter><link linkend="int"><type>int</type></link> tz_offset</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-message-get-date">g_mime_message_get_date</link>             (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>,
                                                         <parameter><link linkend="time-t"><type>time_t</type></link> *date</parameter>,
                                                         <parameter><link linkend="int"><type>int</type></link> *tz_offset</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-message-set-date-as-string">g_mime_message_set_date_as_string</link>   (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *str</parameter>);
<link linkend="char"><returnvalue>char</returnvalue></link> *              <link linkend="g-mime-message-get-date-as-string">g_mime_message_get_date_as_string</link>   (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-message-set-message-id">g_mime_message_set_message_id</link>       (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *message_id</parameter>);
const <link linkend="char"><returnvalue>char</returnvalue></link> *        <link linkend="g-mime-message-get-message-id">g_mime_message_get_message_id</link>       (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-message-set-mime-part">g_mime_message_set_mime_part</link>        (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>,
                                                         <parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *mime_part</parameter>);
<link linkend="GMimeObject"><returnvalue>GMimeObject</returnvalue></link> *       <link linkend="g-mime-message-get-mime-part">g_mime_message_get_mime_part</link>        (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-message-foreach">g_mime_message_foreach</link>              (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>,
                                                         <parameter><link linkend="GMimeObjectForeachFunc"><type>GMimeObjectForeachFunc</type></link> callback</parameter>,
                                                         <parameter><link linkend="gpointer"><type>gpointer</type></link> user_data</parameter>);
<link linkend="GMimeObject"><returnvalue>GMimeObject</returnvalue></link> *       <link linkend="g-mime-message-get-body">g_mime_message_get_body</link>             (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>);
</synopsis>
</refsynopsisdiv>
<refsect1 id="GMimeMessage.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----<link linkend="GMimeObject">GMimeObject</link>
         +----GMimeMessage
</synopsis>
</refsect1>

<refsect1 id="GMimeMessage.description" role="desc">
<title role="desc.title">Description</title>
<para>
A <link linkend="GMimeMessage"><type>GMimeMessage</type></link> represents an rfc822 message.
</para>
</refsect1>
<refsect1 id="GMimeMessage.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GMimeRecipientType" role="enum">
<title>enum GMimeRecipientType</title>
<indexterm zone="GMimeRecipientType"><primary>GMimeRecipientType</primary></indexterm>
<programlisting>typedef enum _GMimeRecipientType {
	GMIME_RECIPIENT_TYPE_TO,
	GMIME_RECIPIENT_TYPE_CC,
	GMIME_RECIPIENT_TYPE_BCC,
} GMimeRecipientType;
</programlisting>
<para>
A message recipient type.
</para><variablelist role="enum">
<varlistentry id="GMIME-RECIPIENT-TYPE-TO:CAPS" role="constant">
<term><literal>GMIME_RECIPIENT_TYPE_TO</literal></term>
<listitem><simpara>Represents the recipients in the To: header.
</simpara></listitem>
</varlistentry>
<varlistentry id="GMIME-RECIPIENT-TYPE-CC:CAPS" role="constant">
<term><literal>GMIME_RECIPIENT_TYPE_CC</literal></term>
<listitem><simpara>Represents the recipients in the Cc: header.
</simpara></listitem>
</varlistentry>
<varlistentry id="GMIME-RECIPIENT-TYPE-BCC:CAPS" role="constant">
<term><literal>GMIME_RECIPIENT_TYPE_BCC</literal></term>
<listitem><simpara>Represents the recipients in the Bcc: header.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="GMimeMessage-struct" role="struct">
<title>GMimeMessage</title>
<indexterm zone="GMimeMessage-struct"><primary>GMimeMessage</primary></indexterm>
<programlisting>typedef struct _GMimeMessage GMimeMessage;</programlisting>
<para>
A MIME Message object.
</para><variablelist role="struct">
</variablelist></refsect2>
<refsect2 id="g-mime-message-new" role="function">
<title>g_mime_message_new ()</title>
<indexterm zone="g-mime-message-new"><primary>g_mime_message_new</primary></indexterm>
<programlisting><link linkend="GMimeMessage"><returnvalue>GMimeMessage</returnvalue></link> *      g_mime_message_new                  (<parameter><link linkend="gboolean"><type>gboolean</type></link> pretty_headers</parameter>);</programlisting>
<para>
If <parameter>pretty_headers</parameter> is <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>, then the standard rfc822 headers are
initialized so as to put headers in a nice friendly order. This is
strictly a cosmetic thing, so if you are unsure, it is safe to say
no (<link linkend="FALSE:CAPS"><literal>FALSE</literal></link>).
</para><variablelist role="params">
<varlistentry><term><parameter>pretty_headers</parameter>&#160;:</term>
<listitem><simpara>make pretty headers 
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> an empty <link linkend="GMimeMessage"><type>GMimeMessage</type></link> object.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-message-set-sender" role="function">
<title>g_mime_message_set_sender ()</title>
<indexterm zone="g-mime-message-set-sender"><primary>g_mime_message_set_sender</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_message_set_sender           (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *sender</parameter>);</programlisting>
<para>
Set the sender's name and address on the MIME Message.
(ex: "\"Joe Sixpack\" &lt;joe<parameter>sixpack.org</parameter>&gt;")
</para><variablelist role="params">
<varlistentry><term><parameter>message</parameter>&#160;:</term>
<listitem><simpara>MIME Message to change
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>sender</parameter>&#160;:</term>
<listitem><simpara>The name and address of the sender
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-message-get-sender" role="function">
<title>g_mime_message_get_sender ()</title>
<indexterm zone="g-mime-message-get-sender"><primary>g_mime_message_get_sender</primary></indexterm>
<programlisting>const <link linkend="char"><returnvalue>char</returnvalue></link> *        g_mime_message_get_sender           (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>);</programlisting>
<para>
Gets the email address of the sender from <parameter>message</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>message</parameter>&#160;:</term>
<listitem><simpara>MIME Message
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the sender's name and address of the MIME Message.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-message-set-reply-to" role="function">
<title>g_mime_message_set_reply_to ()</title>
<indexterm zone="g-mime-message-set-reply-to"><primary>g_mime_message_set_reply_to</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_message_set_reply_to         (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *reply_to</parameter>);</programlisting>
<para>
Set the sender's Reply-To address on the MIME Message.
</para><variablelist role="params">
<varlistentry><term><parameter>message</parameter>&#160;:</term>
<listitem><simpara>MIME Message to change
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>reply_to</parameter>&#160;:</term>
<listitem><simpara>The Reply-To address
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-message-get-reply-to" role="function">
<title>g_mime_message_get_reply_to ()</title>
<indexterm zone="g-mime-message-get-reply-to"><primary>g_mime_message_get_reply_to</primary></indexterm>
<programlisting>const <link linkend="char"><returnvalue>char</returnvalue></link> *        g_mime_message_get_reply_to         (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>);</programlisting>
<para>
Gets the Reply-To address from <parameter>message</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>message</parameter>&#160;:</term>
<listitem><simpara>MIME Message
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the sender's Reply-To address from the MIME Message.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-message-add-recipient" role="function">
<title>g_mime_message_add_recipient ()</title>
<indexterm zone="g-mime-message-add-recipient"><primary>g_mime_message_add_recipient</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_message_add_recipient        (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>,
                                                         <parameter><link linkend="GMimeRecipientType"><type>GMimeRecipientType</type></link> type</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *name</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *addr</parameter>);</programlisting>
<para>
Add a recipient of a chosen type to the MIME Message.
</para><variablelist role="params">
<varlistentry><term><parameter>message</parameter>&#160;:</term>
<listitem><simpara>MIME Message to change
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>type</parameter>&#160;:</term>
<listitem><simpara>A <link linkend="GMimeRecipientType"><type>GMimeRecipientType</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter>&#160;:</term>
<listitem><simpara>The recipient's name (or <link linkend="NULL:CAPS"><literal>NULL</literal></link>)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>addr</parameter>&#160;:</term>
<listitem><simpara>The recipient's address
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-message-get-recipients" role="function">
<title>g_mime_message_get_recipients ()</title>
<indexterm zone="g-mime-message-get-recipients"><primary>g_mime_message_get_recipients</primary></indexterm>
<programlisting><link linkend="InternetAddressList"><returnvalue>InternetAddressList</returnvalue></link> * g_mime_message_get_recipients     (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>,
                                                         <parameter><link linkend="GMimeRecipientType"><type>GMimeRecipientType</type></link> type</parameter>);</programlisting>
<para>
Gets a list of recipients of type <parameter>type</parameter> from <parameter>message</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>message</parameter>&#160;:</term>
<listitem><simpara>MIME Message
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>type</parameter>&#160;:</term>
<listitem><simpara>A <link linkend="GMimeRecipientType"><type>GMimeRecipientType</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a list of recipients of a chosen type from the MIME
Message.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-message-get-all-recipients" role="function">
<title>g_mime_message_get_all_recipients ()</title>
<indexterm zone="g-mime-message-get-all-recipients"><primary>g_mime_message_get_all_recipients</primary></indexterm>
<programlisting><link linkend="InternetAddressList"><returnvalue>InternetAddressList</returnvalue></link> * g_mime_message_get_all_recipients (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>);</programlisting>
<para>
Gets the complete list of recipients for <parameter>message</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>message</parameter>&#160;:</term>
<listitem><simpara>MIME Message
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a newly allocated <link linkend="InternetAddressList"><type>InternetAddressList</type></link> containing all
recipients of the message or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if no recipients are set.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-message-set-subject" role="function">
<title>g_mime_message_set_subject ()</title>
<indexterm zone="g-mime-message-set-subject"><primary>g_mime_message_set_subject</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_message_set_subject          (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *subject</parameter>);</programlisting>
<para>
Set the unencoded UTF-8 Subject field on a MIME Message.
</para><variablelist role="params">
<varlistentry><term><parameter>message</parameter>&#160;:</term>
<listitem><simpara>MIME Message
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>subject</parameter>&#160;:</term>
<listitem><simpara>Subject string
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-message-get-subject" role="function">
<title>g_mime_message_get_subject ()</title>
<indexterm zone="g-mime-message-get-subject"><primary>g_mime_message_get_subject</primary></indexterm>
<programlisting>const <link linkend="char"><returnvalue>char</returnvalue></link> *        g_mime_message_get_subject          (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>);</programlisting>
<para>
Gets the message's subject.
</para><variablelist role="params">
<varlistentry><term><parameter>message</parameter>&#160;:</term>
<listitem><simpara>MIME Message
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the unencoded UTF-8 Subject field on a MIME Message.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-message-set-date" role="function">
<title>g_mime_message_set_date ()</title>
<indexterm zone="g-mime-message-set-date"><primary>g_mime_message_set_date</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_message_set_date             (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>,
                                                         <parameter><link linkend="time-t"><type>time_t</type></link> date</parameter>,
                                                         <parameter><link linkend="int"><type>int</type></link> tz_offset</parameter>);</programlisting>
<para>
Sets the Date header on a MIME Message.
</para><variablelist role="params">
<varlistentry><term><parameter>message</parameter>&#160;:</term>
<listitem><simpara>MIME Message
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>date</parameter>&#160;:</term>
<listitem><simpara>a date to be used in the Date header
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>tz_offset</parameter>&#160;:</term>
<listitem><simpara>timezone offset (in +/- hours)
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-message-get-date" role="function">
<title>g_mime_message_get_date ()</title>
<indexterm zone="g-mime-message-get-date"><primary>g_mime_message_get_date</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_message_get_date             (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>,
                                                         <parameter><link linkend="time-t"><type>time_t</type></link> *date</parameter>,
                                                         <parameter><link linkend="int"><type>int</type></link> *tz_offset</parameter>);</programlisting>
<para>
Stores the date in time_t format in <parameter>date</parameter>. If <parameter>tz_offset</parameter> is
non-<link linkend="NULL:CAPS"><literal>NULL</literal></link>, then the timezone offset in will be stored in
<parameter>tz_offset</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>message</parameter>&#160;:</term>
<listitem><simpara>MIME Message
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>date</parameter>&#160;:</term>
<listitem><simpara>pointer to a date in time_t
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>tz_offset</parameter>&#160;:</term>
<listitem><simpara>pointer to timezone offset (in +/- hours)
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-message-set-date-as-string" role="function">
<title>g_mime_message_set_date_as_string ()</title>
<indexterm zone="g-mime-message-set-date-as-string"><primary>g_mime_message_set_date_as_string</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_message_set_date_as_string   (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *str</parameter>);</programlisting>
<para>
Sets the sent-date of the message.
</para><variablelist role="params">
<varlistentry><term><parameter>message</parameter>&#160;:</term>
<listitem><simpara>MIME Message
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>str</parameter>&#160;:</term>
<listitem><simpara>a date string
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-message-get-date-as-string" role="function">
<title>g_mime_message_get_date_as_string ()</title>
<indexterm zone="g-mime-message-get-date-as-string"><primary>g_mime_message_get_date_as_string</primary></indexterm>
<programlisting><link linkend="char"><returnvalue>char</returnvalue></link> *              g_mime_message_get_date_as_string   (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>);</programlisting>
<para>
Gets the message's sent-date in string format.
</para><variablelist role="params">
<varlistentry><term><parameter>message</parameter>&#160;:</term>
<listitem><simpara>MIME Message
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a newly allocated string containing the Date header value.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-message-set-message-id" role="function">
<title>g_mime_message_set_message_id ()</title>
<indexterm zone="g-mime-message-set-message-id"><primary>g_mime_message_set_message_id</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_message_set_message_id       (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *message_id</parameter>);</programlisting>
<para>
Set the Message-Id on a message.
</para><variablelist role="params">
<varlistentry><term><parameter>message</parameter>&#160;:</term>
<listitem><simpara>MIME Message
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>message_id</parameter>&#160;:</term>
<listitem><simpara>message-id (addr-spec portion)
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-message-get-message-id" role="function">
<title>g_mime_message_get_message_id ()</title>
<indexterm zone="g-mime-message-get-message-id"><primary>g_mime_message_get_message_id</primary></indexterm>
<programlisting>const <link linkend="char"><returnvalue>char</returnvalue></link> *        g_mime_message_get_message_id       (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>);</programlisting>
<para>
Gets the Message-Id header of <parameter>message</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>message</parameter>&#160;:</term>
<listitem><simpara>MIME Message
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the Message-Id of a message.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-message-set-mime-part" role="function">
<title>g_mime_message_set_mime_part ()</title>
<indexterm zone="g-mime-message-set-mime-part"><primary>g_mime_message_set_mime_part</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_message_set_mime_part        (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>,
                                                         <parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *mime_part</parameter>);</programlisting>
<para>
Set the root-level MIME part of the message.
</para><variablelist role="params">
<varlistentry><term><parameter>message</parameter>&#160;:</term>
<listitem><simpara>MIME Message
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mime_part</parameter>&#160;:</term>
<listitem><simpara>The root-level MIME Part
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-message-get-mime-part" role="function">
<title>g_mime_message_get_mime_part ()</title>
<indexterm zone="g-mime-message-get-mime-part"><primary>g_mime_message_get_mime_part</primary></indexterm>
<programlisting><link linkend="GMimeObject"><returnvalue>GMimeObject</returnvalue></link> *       g_mime_message_get_mime_part        (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>);</programlisting>
<para>
Gets the toplevel MIME part contained within <parameter>message</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>message</parameter>&#160;:</term>
<listitem><simpara>MIME Message
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the toplevel MIME part of <parameter>message</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-message-foreach" role="function">
<title>g_mime_message_foreach ()</title>
<indexterm zone="g-mime-message-foreach"><primary>g_mime_message_foreach</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_message_foreach              (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>,
                                                         <parameter><link linkend="GMimeObjectForeachFunc"><type>GMimeObjectForeachFunc</type></link> callback</parameter>,
                                                         <parameter><link linkend="gpointer"><type>gpointer</type></link> user_data</parameter>);</programlisting>
<para>
Recursively calls <parameter>callback</parameter> on each of the mime parts in the mime message.
</para><variablelist role="params">
<varlistentry><term><parameter>message</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeMessage"><type>GMimeMessage</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>callback</parameter>&#160;:</term>
<listitem><simpara>function to call on each of the mime parts contained by the mime message
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user-supplied callback data
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-message-get-body" role="function">
<title>g_mime_message_get_body ()</title>
<indexterm zone="g-mime-message-get-body"><primary>g_mime_message_get_body</primary></indexterm>
<programlisting><link linkend="GMimeObject"><returnvalue>GMimeObject</returnvalue></link> *       g_mime_message_get_body             (<parameter><link linkend="GMimeMessage"><type>GMimeMessage</type></link> *message</parameter>);</programlisting>
<para>
Attempts to identify the MIME part containing the body of the
message.
</para><variablelist role="params">
<varlistentry><term><parameter>message</parameter>&#160;:</term>
<listitem><simpara>MIME Message
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="GMimeObject"><type>GMimeObject</type></link> containing the textual content that appears
to be the main body of the message.

Note: This function is NOT guarenteed to always work as it
makes some assumptions that are not necessarily true. It is
recommended that you traverse the MIME structure yourself.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>

</refentry>
