2 static extern IntPtr g_mime_message_get_recipients (IntPtr message, int type);
4 public InternetAddressList GetRecipients (GMime.RecipientType type)
6 IntPtr list = g_mime_message_get_recipients (Handle, (int) type);
8 return new InternetAddressList (list);
11 public InternetAddressList To {
12 get { return GetRecipients (RecipientType.To); }
15 public InternetAddressList Cc {
16 get { return GetRecipients (RecipientType.Cc); }
19 public InternetAddressList Bcc {
20 get { return GetRecipients (RecipientType.Bcc); }
23 public System.Collections.IEnumerable References {
25 GMime.HeaderList headers = HeaderList;
30 string references = headers["References"];
32 if (references == null)
35 GMime.References refs = GMime.References.Parse (references);
36 GMime.References iter = refs;
38 while (iter != null) {
48 static extern IntPtr internet_address_list_to_string (IntPtr list, bool encode);
50 public string GetRecipientsAsString (GMime.RecipientType type, bool encode)
52 IntPtr list = g_mime_message_get_recipients (Handle, (int) type);
55 if (list == IntPtr.Zero)
58 str = internet_address_list_to_string (list, encode);
60 return GLib.Marshaller.PtrToStringGFree (str);
63 public string GetRecipientsAsString (GMime.RecipientType type)
65 return GetRecipientsAsString (type, false);
69 static extern void g_mime_message_get_date (IntPtr message, out IntPtr date, out int gmt_offset);
72 static extern void g_mime_message_set_date (IntPtr message, IntPtr date, int gmt_offset);
74 public DateTime Date {
79 g_mime_message_get_date (Handle, out date, out tz_offset);
81 return GLib.Marshaller.time_tToDateTime (date);
85 g_mime_message_set_date (Handle, GLib.Marshaller.DateTimeTotime_t (value), 0);