GMime 2.4 Reference Manual | ||||
---|---|---|---|---|
enum GMimeRecipientType; 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);
typedef enum _GMimeRecipientType { 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 MIME Message 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
>")
|
MIME Message to change |
|
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
.
|
MIME Message |
Returns : |
the sender's name and address of the MIME Message. |
void g_mime_message_set_reply_to (GMimeMessage *message, const char *reply_to);
Set the sender's Reply-To address on the MIME Message.
|
MIME Message to change |
|
The Reply-To address |
const char* g_mime_message_get_reply_to (GMimeMessage *message);
Gets the Reply-To address from message
.
|
MIME Message |
Returns : |
the sender's Reply-To address from the MIME Message. |
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.
|
MIME Message to change |
|
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 type type
from message
.
|
MIME Message |
|
A GMimeRecipientType |
Returns : |
a list of recipients of a chosen type from the MIME Message. |
InternetAddressList* g_mime_message_get_all_recipients (GMimeMessage *message);
Gets the complete list of recipients for message
.
|
MIME Message |
Returns : |
a newly allocated InternetAddressList containing all
recipients of the message or NULL if no recipients are set.
|
void g_mime_message_set_subject (GMimeMessage *message, const char *subject);
Set the unencoded UTF-8 Subject field on a MIME Message.
|
MIME Message |
|
Subject string |
const char* g_mime_message_get_subject (GMimeMessage *message);
Gets the message's subject.
|
MIME Message |
Returns : |
the unencoded UTF-8 Subject field on a MIME Message. |
void g_mime_message_set_date (GMimeMessage *message, time_t date, int tz_offset);
Sets the Date header on a MIME Message.
|
MIME Message |
|
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
.
|
MIME Message |
|
pointer to a date in time_t |
|
pointer to timezone offset (in +/- hours) |
void g_mime_message_set_date_as_string (GMimeMessage *message, const char *str);
Sets the sent-date of the message.
|
MIME Message |
|
a date string |
char* g_mime_message_get_date_as_string (GMimeMessage *message);
Gets the message's sent-date in string format.
|
MIME Message |
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.
|
MIME Message |
|
message-id (addr-spec portion) |
const char* g_mime_message_get_message_id (GMimeMessage *message);
Gets the Message-Id header of message
.
|
MIME Message |
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.
|
MIME Message |
|
The root-level MIME Part |
GMimeObject* g_mime_message_get_mime_part (GMimeMessage *message);
Gets the toplevel MIME part contained within message
.
|
MIME Message |
Returns : |
the toplevel MIME part of message .
|
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 |
|
user-supplied callback data |