File: test_compose_mail.c

package info (click to toggle)
modest 3.90.4-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 7,400 kB
  • ctags: 8,562
  • sloc: ansic: 88,775; makefile: 959; xml: 122; sh: 57
file content (44 lines) | stat: -rw-r--r-- 1,156 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <libmodest-dbus-client/libmodest-dbus-client.h>
#include <stdio.h>


int main(int argc, char *argv[])
{
	GSList *attachments = NULL;
	/* Initialize maemo application */
	osso_context_t * osso_context = osso_initialize(
	    "test_hello", "0.0.1", TRUE, NULL);
	       
	/* Check that initialization was ok */
	if (osso_context == NULL)
	{
		printf("osso_initialize() failed.\n");
	    return OSSO_ERROR;
	}
	
	/* Call the function in libmodest-dbus-client: */
	
	attachments = g_slist_append(attachments, "file:///usr/include/math.h");
	attachments = g_slist_append(attachments, "file:///usr/include/glib-2.0/glib.h");
	attachments = g_slist_append(attachments, "file:///tmp/file,coma.txt");
	
	const gboolean ret = libmodest_dbus_client_compose_mail (
		osso_context,
		"modesttest@modesttest.com", /* to */
		"cc test", /* cc */
		"bcc test", /* bcc */
		"test subject", /* subject */
		"test body\nline two", /* body */
		attachments);
		
	
	if (!ret) {
		printf("libmodest_dbus_client_compose_mail() failed.\n");
		return OSSO_ERROR;
	} else {
		printf("libmodest_dbus_client_compose_mail() succeeded\n");
	}
		
    /* Exit */
    return 0;
}