|  |  |  | GMime 2.6 Reference Manual |  | 
|---|---|---|---|---|
| Top | Description | Object Hierarchy | ||||
enum GMimeRecipientType; struct GMimeMessage; GMimeMessage * g_mime_message_new (gboolean pretty_headers); void g_mime_message_set_sender (GMimeMessage *message,const char *sender); const char * g_mime_message_get_sender (GMimeMessage *message); void g_mime_message_set_reply_to (GMimeMessage *message,const char *reply_to); const char * g_mime_message_get_reply_to (GMimeMessage *message); void g_mime_message_add_recipient (GMimeMessage *message,GMimeRecipientType type,const char *name,const char *addr); InternetAddressList * g_mime_message_get_recipients (GMimeMessage *message,GMimeRecipientType type); InternetAddressList * g_mime_message_get_all_recipients (GMimeMessage *message); void g_mime_message_set_subject (GMimeMessage *message,const char *subject); const char * g_mime_message_get_subject (GMimeMessage *message); void g_mime_message_set_date (GMimeMessage *message,time_t date,int tz_offset); void g_mime_message_get_date (GMimeMessage *message,time_t *date,int *tz_offset); void g_mime_message_set_date_as_string (GMimeMessage *message,const char *str); char * g_mime_message_get_date_as_string (GMimeMessage *message); void g_mime_message_set_message_id (GMimeMessage *message,const char *message_id); const char * g_mime_message_get_message_id (GMimeMessage *message); void g_mime_message_set_mime_part (GMimeMessage *message,GMimeObject *mime_part); GMimeObject * g_mime_message_get_mime_part (GMimeMessage *message); void g_mime_message_foreach (GMimeMessage *message,GMimeObjectForeachFunc callback,gpointer user_data); GMimeObject * g_mime_message_get_body (GMimeMessage *message);
typedef enum {
	GMIME_RECIPIENT_TYPE_TO,
	GMIME_RECIPIENT_TYPE_CC,
	GMIME_RECIPIENT_TYPE_BCC
} GMimeRecipientType;
A message recipient type.
GMimeMessage *      g_mime_message_new                  (gboolean pretty_headers);
If pretty_headers is TRUE, 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 (FALSE).
| 
 | make pretty headers | 
| Returns : | an empty GMimeMessage object. | 
void g_mime_message_set_sender (GMimeMessage *message,const char *sender);
Set the sender's name and address on the MIME Message.
(ex: "\"Joe Sixpack\" <joesixpack.org>")
Note: The sender string should be the raw encoded email
address. It is probably best to use an InternetAddress to
construct and encode this value.
| 
 | A GMimeMessage | 
| 
 | The name and address of the sender | 
const char *        g_mime_message_get_sender           (GMimeMessage *message);
Gets the email address of the sender from message.
| 
 | A GMimeMessage | 
| Returns : | the sender's name and address of the messagein a form
suitable for display orNULLif no sender is set. If notNULL,
the returned string will be in UTF-8. | 
void g_mime_message_set_reply_to (GMimeMessage *message,const char *reply_to);
Set the sender's Reply-To address on the message.
Note: The reply_to string should be the raw encoded email
address. It is probably best to use an InternetAddress to
construct and encode this value.
| 
 | A GMimeMessage | 
| 
 | The Reply-To address | 
const char *        g_mime_message_get_reply_to         (GMimeMessage *message);
Gets the Reply-To address from message.
| 
 | A GMimeMessage | 
| Returns : | the sender's Reply-To address in a form suitable for
display or NULLif no Reply-To address is set. If notNULL, the
returned string will be in UTF-8. | 
void g_mime_message_add_recipient (GMimeMessage *message,GMimeRecipientType type,const char *name,const char *addr);
Add a recipient of a chosen type to the MIME message.
Note: The name (and addr) strings should be in UTF-8.
| 
 | A GMimeMessage | 
| 
 | A GMimeRecipientType | 
| 
 | The recipient's name (or NULL) | 
| 
 | The recipient's address | 
InternetAddressList * g_mime_message_get_recipients (GMimeMessage *message,GMimeRecipientType type);
Gets a list of recipients of the specified type from the message.
| 
 | A GMimeMessage | 
| 
 | A GMimeRecipientType | 
| Returns : | a list of recipients of the specified typefrom themessage. [transfer none] | 
InternetAddressList * g_mime_message_get_all_recipients (GMimeMessage *message);
Gets the complete list of recipients for message.
| 
 | A GMimeMessage | 
| Returns : | a newly allocated InternetAddressList
containing all recipients of the message or NULLif no recipients
are set. [transfer full] | 
void g_mime_message_set_subject (GMimeMessage *message,const char *subject);
Set the subject of a message.
Note: The subject string should be in UTF-8.
| 
 | A GMimeMessage | 
| 
 | Subject string | 
const char *        g_mime_message_get_subject          (GMimeMessage *message);
Gets the subject of the message.
| 
 | A GMimeMessage | 
| Returns : | the subject of the messagein a form suitable for display
orNULLif no subject is set. If notNULL, the returned string
will be in UTF-8. | 
void g_mime_message_set_date (GMimeMessage *message,time_t date,int tz_offset);
Sets the Date header on a MIME Message.
| 
 | A GMimeMessage | 
| 
 | a date to be used in the Date header | 
| 
 | timezone offset (in +/- hours) | 
void g_mime_message_get_date (GMimeMessage *message,time_t *date,int *tz_offset);
Stores the date in time_t format in date. If tz_offset is
non-NULL, then the timezone offset in will be stored in
tz_offset.
| 
 | A GMimeMessage | 
| 
 | pointer to a date in time_t. [out] | 
| 
 | pointer to timezone offset (in +/- hours). [out] | 
void g_mime_message_set_date_as_string (GMimeMessage *message,const char *str);
Sets the sent-date of the message.
| 
 | A GMimeMessage | 
| 
 | a date string | 
char *              g_mime_message_get_date_as_string   (GMimeMessage *message);
Gets the message's sent-date in string format.
| 
 | A GMimeMessage | 
| Returns : | a newly allocated string containing the Date header value. | 
void g_mime_message_set_message_id (GMimeMessage *message,const char *message_id);
Set the Message-Id on a message.
| 
 | A GMimeMessage | 
| 
 | message-id (addr-spec portion) | 
const char *        g_mime_message_get_message_id       (GMimeMessage *message);
Gets the Message-Id header of message.
| 
 | A GMimeMessage | 
| Returns : | the Message-Id of a message. | 
void g_mime_message_set_mime_part (GMimeMessage *message,GMimeObject *mime_part);
Set the root-level MIME part of the message.
| 
 | A GMimeMessage | 
| 
 | The root-level MIME Part | 
GMimeObject *       g_mime_message_get_mime_part        (GMimeMessage *message);
Gets the toplevel MIME part contained within message.
| 
 | A GMimeMessage | 
| Returns : | the toplevel MIME part of message. [transfer none] | 
void g_mime_message_foreach (GMimeMessage *message,GMimeObjectForeachFunc callback,gpointer user_data);
Recursively calls callback on each of the mime parts in the mime message.
| 
 | A GMimeMessage | 
| 
 | function to call on each of the mime parts contained by the mime message. [scope call] | 
| 
 | user-supplied callback data | 
GMimeObject *       g_mime_message_get_body             (GMimeMessage *message);
Attempts to identify the MIME part containing the body of the message.
| 
 | A GMimeMessage | 
| Returns : | a GMimeObject 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. [transfer none] |